Add docker-compose Playwright E2E stack

This commit is contained in:
Lain Soykaf 2026-01-07 09:44:50 +04:00
commit 7ffec2c324
12 changed files with 359 additions and 65 deletions

32
tools/e2e/run.sh Normal file
View file

@ -0,0 +1,32 @@
#!/bin/sh
set -u
COMPOSE_FILE="docker-compose.e2e.yml"
: "${PLEROMA_IMAGE:=git.pleroma.social:5050/pleroma/pleroma:stable}"
: "${E2E_ADMIN_USERNAME:=admin}"
: "${E2E_ADMIN_PASSWORD:=adminadmin}"
: "${E2E_ADMIN_EMAIL:=admin@example.com}"
cleanup() {
docker compose -f "$COMPOSE_FILE" down -v --remove-orphans >/dev/null 2>&1 || true
}
cleanup
trap 'cleanup; exit 130' INT TERM
set +e
docker compose -f "$COMPOSE_FILE" up --build --remove-orphans --abort-on-container-exit --exit-code-from e2e
result="$?"
set -e
if [ "$result" -ne 0 ]; then
docker compose -f "$COMPOSE_FILE" cp e2e:/app/test/e2e-playwright/test-results test/e2e-playwright/test-results >/dev/null 2>&1 || true
docker compose -f "$COMPOSE_FILE" cp e2e:/app/test/e2e-playwright/playwright-report test/e2e-playwright/playwright-report >/dev/null 2>&1 || true
fi
cleanup
exit "$result"