From 49b5a91f4a9baef40e03f88691edc99b120dd5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Thu, 21 May 2026 15:57:06 +0200 Subject: [PATCH] Include E2E browser tests in ./gradlew check. Local verification should match Forgejo CI. Wire frontendE2E into check and point it at docker-compose.e2e.yml with the same test env vars. - Add frontendE2E to check after frontend unit tests - Run docker-compose.e2e.yml directly from Gradle with CI secrets - Update npm test:e2e:ci to use the e2e compose file --- build.gradle | 18 ++++++++++++++---- frontend/package.json | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index f7a9181..c305bf5 100644 --- a/build.gradle +++ b/build.gradle @@ -28,13 +28,23 @@ tasks.register('coverage') { } tasks.register('frontendE2E', Exec) { - description = 'Run Playwright E2E tests in Docker (CI mode)' - workingDir = file("${rootProject.projectDir}/frontend") - commandLine 'npm', 'run', 'test:e2e:ci' + group = 'verification' + description = 'Run Playwright E2E tests in Docker (same stack as Forgejo CI)' + dependsOn frontendTest + workingDir = rootProject.projectDir + environment 'POSTGRES_DB', 'bilhej' + environment 'POSTGRES_USER', 'bilhej' + environment 'POSTGRES_PASSWORD', 'test_pw_ci_123' + environment 'JWT_SECRET', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + environment 'STRIPE_SECRET_KEY', 'sk_test_fake' + environment 'STRIPE_WEBHOOK_SECRET', 'whsec_fake' + environment 'STRIPE_PRICE_ID', 'price_fake' + commandLine 'docker', 'compose', '-f', 'docker-compose.e2e.yml', + 'up', '--build', '--abort-on-container-exit', '--exit-code-from', 'playwright' } tasks.named('check').configure { - dependsOn frontendLint, frontendTest + dependsOn frontendLint, frontendTest, frontendE2E } tasks.register('up', Exec) { diff --git a/frontend/package.json b/frontend/package.json index a35efb0..ec3c316 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,7 +13,7 @@ "test:watch": "vitest", "test:coverage": "vitest run --coverage", "test:e2e": "playwright test", - "test:e2e:ci": "docker compose -f ../docker-compose.ci.yml up --build --abort-on-container-exit --exit-code-from playwright" + "test:e2e:ci": "docker compose -f ../docker-compose.e2e.yml up --build --abort-on-container-exit --exit-code-from playwright" }, "dependencies": { "pinia": "^3.0.4",