From 29d291d75626b7750cdd78f1090f2890d2d3dbf0 Mon Sep 17 00:00:00 2001 From: Phil Rzewski Date: Mon, 8 Jan 2024 22:06:46 +0000 Subject: [PATCH] On GitHub Actions, run only the e2e tests that are reliable there (#2954) --- .github/workflows/advance-zed.yml | 2 +- .github/workflows/e2e.yml | 31 +++++++++++++++++++++++++++++++ package.json | 3 ++- packages/zui-player/ci.config.js | 7 +++++++ packages/zui-player/package.json | 3 ++- 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/e2e.yml create mode 100644 packages/zui-player/ci.config.js diff --git a/.github/workflows/advance-zed.yml b/.github/workflows/advance-zed.yml index ff364f0a6a..542aea4d63 100644 --- a/.github/workflows/advance-zed.yml +++ b/.github/workflows/advance-zed.yml @@ -45,7 +45,7 @@ jobs: uses: GabrielBB/xvfb-action@v1 with: options: -screen 0 1280x1024x24 - run: yarn e2e + run: yarn e2e:ci - uses: actions/upload-artifact@v2 if: failure() && steps.playwright.outcome == 'failure' with: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000000..086480862b --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,31 @@ +name: Run e2e tests + +on: + workflow_dispatch: + +jobs: + run-e2e-tests: + name: Run e2e tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04] + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-zui + - run: yarn lint + - run: yarn test + - run: yarn build + - name: End to end tests + id: playwright + uses: GabrielBB/xvfb-action@v1 + with: + options: -screen 0 1280x1024x24 + run: yarn e2e:ci + - uses: actions/upload-artifact@v2 + if: failure() && steps.playwright.outcome == 'failure' + with: + name: artifacts-${{ matrix.os }} + path: | + run/playwright-itest + !run/**/SS diff --git a/package.json b/package.json index b13ae0c811..75c3a4ebfb 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "lint": "nx run-many -t lint --all --exclude zui-player", "test": "nx run-many -t test --all --exclude zui-player --skip-nx-cache", "start": "nx start zui", - "e2e": "NODE_ENV=production nx test zui-player" + "e2e": "NODE_ENV=production nx test zui-player", + "e2e:ci": "NODE_ENV=production nx ci zui-player" }, "devDependencies": { "@nx-go/nx-go": "^2.7.0", diff --git a/packages/zui-player/ci.config.js b/packages/zui-player/ci.config.js new file mode 100644 index 0000000000..2910a4e232 --- /dev/null +++ b/packages/zui-player/ci.config.js @@ -0,0 +1,7 @@ +const baseConfig = require('./playwright.config'); + +module.exports = { + ...baseConfig, + /* This is the list of flaky tests to ignore when running on CI */ + testIgnore: /(pool-loads|pool-groups|title-bar-buttons).spec/, +}; diff --git a/packages/zui-player/package.json b/packages/zui-player/package.json index a841ff77ca..7e54b82f80 100644 --- a/packages/zui-player/package.json +++ b/packages/zui-player/package.json @@ -3,7 +3,8 @@ "private": true, "main": "./index.ts", "scripts": { - "test": "playwright test --config playwright.config.js" + "test": "playwright test -c playwright.config.js", + "ci": "playwright test -c ci.config.js" }, "dependencies": { "@playwright/test": "next",