From d299eee2e1989235711a08aae57e7fdf36f56bff Mon Sep 17 00:00:00 2001 From: April Hall Date: Fri, 28 Feb 2025 08:37:39 -0500 Subject: [PATCH] ci: Finish setting up testing CI --- .github/workflows/playwright.yml | 15 +++++++++------ playwright.config.ts | 10 ++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index fb9564e..85eeb9f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -11,7 +11,11 @@ jobs: image: cassandra:latest ports: - 9042:9042 - options: --health-cmd="nodetool status" --health-interval=10s --health-timeout=5s --health-retries=5 + options: >- + --health-cmd="nodetool status" + --health-interval=10s + --health-timeout=5s + --health-retries=5 env: CASSANDRA_USER: admin CASSANDRA_PASSWORD: admin @@ -23,7 +27,6 @@ jobs: env: MINIO_ROOT_USER: minioadmin MINIO_ROOT_PASSWORD: minioadmin - steps: - name: Checkout code uses: actions/checkout@v4 @@ -43,12 +46,12 @@ jobs: run: bun run migrate - name: Setup environment - run: | - cp .env.example .env - sudo echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts + run: cp .env.example .env - name: Run Playwright tests - run: bun run test + run: | + bun run dev --host & + bun run test env: NODE_ENV: testing diff --git a/playwright.config.ts b/playwright.config.ts index d8e35f6..16fc586 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -19,17 +19,11 @@ export default defineConfig({ testMatch: /(.+\.)?(test|spec)\.[jt]s/, }, ], - retries: !process.env.CI ? 1 : 0, + retries: process.env.CI ? 1 : 0, reporter: 'list', - webServer: { - command: 'npm run dev --host', - port: 5173, - // Reuses webserver only in non-ci enviroments - reuseExistingServer: !process.env.CI, - }, workers: 1, use: { - baseURL: 'http://127.0.0.1:5173', + baseURL: 'http://localhost:5173', trace: 'on-first-retry', }, });