From 24a6190f5144834d2415c7640321e6d3dc70491f Mon Sep 17 00:00:00 2001 From: giancarlo Date: Fri, 12 Apr 2024 19:08:29 +0800 Subject: [PATCH] Update CI settings for e2e tests Adjusted the parallel test limit on CI from 1 to 2 in playwright configuration and updated the test script to stop after the first failure. These changes will allow CI to run tests more efficiently and stop running further tests when a failure is encountered. --- .github/workflows/workflow.yml | 6 +++--- apps/e2e/package.json | 2 +- apps/e2e/playwright.config.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6ce1c5860..62008f5c9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,7 +6,7 @@ on: branches: [ main ] jobs: typescript: - timeout-minutes: 10 + timeout-minutes: 8 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -37,7 +37,7 @@ jobs: run: pnpm run lint test: - timeout-minutes: 15 + timeout-minutes: 8 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -96,4 +96,4 @@ jobs: with: name: playwright-report path: playwright-report/ - retention-days: 7 + retention-days: 7 \ No newline at end of file diff --git a/apps/e2e/package.json b/apps/e2e/package.json index 3eb866081..18a06743d 100644 --- a/apps/e2e/package.json +++ b/apps/e2e/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "report": "playwright show-report", - "test": "playwright test", + "test": "playwright test --max-failures=1", "test:ui": "playwright test --ui" }, "keywords": [], diff --git a/apps/e2e/playwright.config.ts b/apps/e2e/playwright.config.ts index 1c8cdd282..feb9be176 100644 --- a/apps/e2e/playwright.config.ts +++ b/apps/e2e/playwright.config.ts @@ -16,8 +16,8 @@ export default defineConfig({ /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, retries: process.env.CI ? 3 : 1, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + /* Limit parallel tests on CI. */ + workers: process.env.CI ? 2 : undefined, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ reporter: 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */