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:
parent
ec122e86b8
commit
49b5a91f4a
2 changed files with 15 additions and 5 deletions
18
build.gradle
18
build.gradle
|
|
@ -28,13 +28,23 @@ tasks.register('coverage') {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('frontendE2E', Exec) {
|
tasks.register('frontendE2E', Exec) {
|
||||||
description = 'Run Playwright E2E tests in Docker (CI mode)'
|
group = 'verification'
|
||||||
workingDir = file("${rootProject.projectDir}/frontend")
|
description = 'Run Playwright E2E tests in Docker (same stack as Forgejo CI)'
|
||||||
commandLine 'npm', 'run', 'test:e2e: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 {
|
tasks.named('check').configure {
|
||||||
dependsOn frontendLint, frontendTest
|
dependsOn frontendLint, frontendTest, frontendE2E
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('up', Exec) {
|
tasks.register('up', Exec) {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
"test:watch": "vitest",
|
"test:watch": "vitest",
|
||||||
"test:coverage": "vitest run --coverage",
|
"test:coverage": "vitest run --coverage",
|
||||||
"test:e2e": "playwright test",
|
"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": {
|
"dependencies": {
|
||||||
"pinia": "^3.0.4",
|
"pinia": "^3.0.4",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue