From 8fd18b08ab32755432f23bc5f228a499f7ad5cc9 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 8 Mar 2026 13:46:34 -0500 Subject: [PATCH] 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 --- .forgejo/workflows/production.yaml | 4 +++- e2e/playwright.config.ts | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/production.yaml b/.forgejo/workflows/production.yaml index bc963adc..0401588a 100644 --- a/.forgejo/workflows/production.yaml +++ b/.forgejo/workflows/production.yaml @@ -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 diff --git a/e2e/playwright.config.ts b/e2e/playwright.config.ts index b0b3e46b..5dcda019 100644 --- a/e2e/playwright.config.ts +++ b/e2e/playwright.config.ts @@ -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'], },