Browse Source

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

pull/6524/head
Muhammed Mustafa 1 year ago
parent
commit
d6482fa6bf
  1. 12
      .github/workflows/ci-cd.yml
  2. 5
      .github/workflows/playwright-test-workflow.yml
  3. 13
      tests/playwright/playwright.config.ts

12
.github/workflows/ci-cd.yml

@ -110,7 +110,6 @@ jobs:
with: with:
db: mysql db: mysql
shard: 1 shard: 1
workers: 4
playwright-mysql-2: playwright-mysql-2:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -118,7 +117,6 @@ jobs:
with: with:
db: mysql db: mysql
shard: 2 shard: 2
workers: 4
playwright-mysql-3: playwright-mysql-3:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -126,7 +124,6 @@ jobs:
with: with:
db: mysql db: mysql
shard: 3 shard: 3
workers: 4
playwright-mysql-4: playwright-mysql-4:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -134,7 +131,6 @@ jobs:
with: with:
db: mysql db: mysql
shard: 4 shard: 4
workers: 4
playwright-sqlite-1: playwright-sqlite-1:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -142,7 +138,6 @@ jobs:
with: with:
db: sqlite db: sqlite
shard: 1 shard: 1
workers: 1
playwright-sqlite-2: playwright-sqlite-2:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -150,7 +145,6 @@ jobs:
with: with:
db: sqlite db: sqlite
shard: 2 shard: 2
workers: 1
playwright-sqlite-3: playwright-sqlite-3:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -158,7 +152,6 @@ jobs:
with: with:
db: sqlite db: sqlite
shard: 3 shard: 3
workers: 1
playwright-sqlite-4: playwright-sqlite-4:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -166,7 +159,6 @@ jobs:
with: with:
db: sqlite db: sqlite
shard: 4 shard: 4
workers: 1
playwright-pg-shard-1: playwright-pg-shard-1:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -174,7 +166,6 @@ jobs:
with: with:
db: pg db: pg
shard: 1 shard: 1
workers: 4
playwright-pg-shard-2: playwright-pg-shard-2:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -182,7 +173,6 @@ jobs:
with: with:
db: pg db: pg
shard: 2 shard: 2
workers: 4
playwright-pg-shard-3: playwright-pg-shard-3:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -190,7 +180,6 @@ jobs:
with: with:
db: pg db: pg
shard: 3 shard: 3
workers: 4
playwright-pg-shard-4: playwright-pg-shard-4:
needs: pre-build-for-playwright needs: pre-build-for-playwright
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }} if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}
@ -198,4 +187,3 @@ jobs:
with: with:
db: pg db: pg
shard: 4 shard: 4
workers: 4

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

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

13
tests/playwright/playwright.config.ts

@ -10,6 +10,14 @@ require('dotenv').config();
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
let workers = process.env.CI ? 2 : 4;
if (process.env.CI) {
if (process.env.E2E_DB_TYPE === 'sqlite') workers = 1;
if (process.env.E2E_DB_TYPE === 'mysql') workers = 4;
if (process.env.E2E_DB_TYPE === 'pg') workers = 4;
}
export default defineConfig({ export default defineConfig({
testDir: process.env.PW_QUICK_TEST ? './quickTests' : './tests', testDir: process.env.PW_QUICK_TEST ? './quickTests' : './tests',
/* Maximum time one test can run for. */ /* Maximum time one test can run for. */
@ -29,8 +37,7 @@ export default defineConfig({
/* Retry on CI only */ /* Retry on CI only */
retries: process.env.CI ? 3 : 0, retries: process.env.CI ? 3 : 0,
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
// workers: process.env.CI ? 2 : 4, workers: workers,
workers: process.env.CI ? 2 : 4,
/* 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. */
@ -38,7 +45,7 @@ export default defineConfig({
// headless: !!process.env.CI, // headless: !!process.env.CI,
headless: true, headless: true,
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: process.env.E2E_DB_TYPE === 'sqlite' ? 12000 : 4000, actionTimeout: 4000,
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000', baseURL: 'http://localhost:3000',

Loading…
Cancel
Save