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
This commit is contained in:
Joakim Mörling 2026-05-21 15:57:06 +02:00
parent ec122e86b8
commit 49b5a91f4a
2 changed files with 15 additions and 5 deletions

View file

@ -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) {

View file

@ -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",