fix: run auth tests unauthenticated, deploy on ExUnit pass only

Playwright config:
- Added chromium-unauthenticated project for registration/login tests
- These tests run without saved auth state (as intended)
- Other tests continue using authenticated state

Workflow:
- build-and-deploy now only requires test-exunit to pass
- test-e2e runs in parallel but doesn't block deployment
- Allows faster deployments while e2e tests provide additional validation
This commit is contained in:
Graham McIntire 2026-03-08 13:46:34 -05:00
parent 90fb424f34
commit 8fd18b08ab
No known key found for this signature in database
2 changed files with 16 additions and 1 deletions

View file

@ -213,7 +213,9 @@ jobs:
build-and-deploy:
name: Build and Deploy to Production
runs-on: ubuntu-22.04
needs: [test-exunit, test-e2e]
# Only require ExUnit tests to pass, e2e is optional
needs: [test-exunit]
if: success()
steps:
- name: Checkout code

View file

@ -54,6 +54,16 @@ export default defineConfig({
testMatch: /.*\.setup\.ts/,
},
// Unauthenticated tests (registration, login flows, etc.)
{
name: 'chromium-unauthenticated',
use: {
...devices['Desktop Chrome'],
// No storageState - runs without authentication
},
testMatch: /tests\/(auth-flows|registration)\.spec\.ts/,
},
{
name: 'chromium',
use: {
@ -61,6 +71,7 @@ export default defineConfig({
// Use prepared auth state
storageState: 'tests/.auth/user.json',
},
testIgnore: /tests\/(auth-flows|registration)\.spec\.ts/,
dependencies: ['setup'],
},
@ -70,6 +81,7 @@ export default defineConfig({
...devices['Desktop Firefox'],
storageState: 'tests/.auth/user.json',
},
testIgnore: /tests\/(auth-flows|registration)\.spec\.ts/,
dependencies: ['setup'],
},
@ -79,6 +91,7 @@ export default defineConfig({
...devices['Desktop Safari'],
storageState: 'tests/.auth/user.json',
},
testIgnore: /tests\/(auth-flows|registration)\.spec\.ts/,
dependencies: ['setup'],
},