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.
This commit is contained in:
giancarlo
2024-04-12 19:08:29 +08:00
parent f7de3ea9c4
commit 24a6190f51
3 changed files with 6 additions and 6 deletions

View File

@@ -6,7 +6,7 @@ on:
branches: [ main ] branches: [ main ]
jobs: jobs:
typescript: typescript:
timeout-minutes: 10 timeout-minutes: 8
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -37,7 +37,7 @@ jobs:
run: pnpm run lint run: pnpm run lint
test: test:
timeout-minutes: 15 timeout-minutes: 8
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -96,4 +96,4 @@ jobs:
with: with:
name: playwright-report name: playwright-report
path: playwright-report/ path: playwright-report/
retention-days: 7 retention-days: 7

View File

@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"report": "playwright show-report", "report": "playwright show-report",
"test": "playwright test", "test": "playwright test --max-failures=1",
"test:ui": "playwright test --ui" "test:ui": "playwright test --ui"
}, },
"keywords": [], "keywords": [],

View File

@@ -16,8 +16,8 @@ export default defineConfig({
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI, forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 1, retries: process.env.CI ? 3 : 1,
/* Opt out of parallel tests on CI. */ /* Limit parallel tests on CI. */
workers: process.env.CI ? 1 : undefined, workers: process.env.CI ? 2 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html', reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */