Browse Source

fix: Increased worker count and increased test action timeout to test stability

pull/6524/head
Muhammed Mustafa 1 year ago
parent
commit
e8a07675cd
  1. 38
      .github/workflows/ci-cd.yml
  2. 5
      .github/workflows/playwright-test-workflow.yml
  3. 8
      tests/playwright/package.json

38
.github/workflows/ci-cd.yml

@ -108,29 +108,33 @@ jobs:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
db: mysql
shard: 1
workers: 4
playwright-mysql-2:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
db: mysql
shard: 2
workers: 4
playwright-mysql-3:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
db: mysql
shard: 3
workers: 4
playwright-mysql-4:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 4
db: mysql
shard: 4
workers: 4
playwright-sqlite-1:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -138,6 +142,7 @@ jobs:
with:
db: sqlite
shard: 1
workers: 1
playwright-sqlite-2:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -145,45 +150,52 @@ jobs:
with:
db: sqlite
shard: 2
workers: 1
playwright-sqlite-3:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 3
shard: 3
workers: 1
playwright-sqlite-4:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 4
shard: 4
workers: 1
playwright-pg-shard-1:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
db: pg
shard: 1
workers: 4
playwright-pg-shard-2:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
db: pg
shard: 2
workers: 4
playwright-pg-shard-3:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 3
db: pg
shard: 3
workers: 4
playwright-pg-shard-4:
needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
uses: ./.github/workflows/playwright-test-workflow.yml
with:
db: sqlite
shard: 4
db: pg
shard: 4
workers: 4

5
.github/workflows/playwright-test-workflow.yml

@ -10,6 +10,9 @@ on:
db:
required: true
type: string
workers:
required: true
type: string
jobs:
playwright:
@ -144,7 +147,7 @@ jobs:
timeout-minutes: 2
- name: Run Playwright Tests
working-directory: ./tests/playwright
run: E2E_DB_TYPE=${{ inputs.db }} npm run ci:test:shard:${{ inputs.shard }}
run: E2E_DB_TYPE=${{ inputs.db }} npm run ci:test:shard:${{ inputs.shard }} --workers=${{ inputs.workers }}
timeout-minutes: 60
# Stress test added/modified tests
- name: Fetch develop branch

8
tests/playwright/package.json

@ -30,10 +30,10 @@
"test:debug:watch": "pnpm dlx nodemon -e ts -w ./ -x \"pnpm run test:debug\"",
"test:debug:quick:sqlite": "./startPlayWrightServer.sh; PW_QUICK_TEST=1 PW_TEST_REUSE_CONTEXT=1 PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:31000/ PWDEBUG=console pnpm exec playwright test -c playwright.config.ts --headed --project=chromium --retries 0 --timeout 5 --workers 1 --max-failures=1",
"ci:test": "pnpm exec playwright test --workers=2",
"ci:test:shard:1": "pnpm exec playwright test --workers=2 --shard=1/4",
"ci:test:shard:2": "pnpm exec playwright test --workers=2 --shard=2/4",
"ci:test:shard:3": "pnpm exec playwright test --workers=2 --shard=3/4",
"ci:test:shard:4": "pnpm exec playwright test --workers=2 --shard=4/4",
"ci:test:shard:1": "pnpm exec playwright test --shard=1/4",
"ci:test:shard:2": "pnpm exec playwright test --shard=2/4",
"ci:test:shard:3": "pnpm exec playwright test --shard=3/4",
"ci:test:shard:4": "pnpm exec playwright test --shard=4/4",
"ci:test:flaky:repeat": "pnpm exec playwright test --workers=4 --grep @flaky --repeat-each=3",
"ci:test:mysql": "E2E_DB_TYPE=mysql pnpm exec playwright test --workers=2",
"ci:test:pg": "E2E_DB_TYPE=pg pnpm exec playwright test --workers=2",

Loading…
Cancel
Save