From a8a00e075418ac9176a1221a87dfb3e16ce458ab Mon Sep 17 00:00:00 2001 From: Derek Date: Fri, 12 Jan 2024 09:14:27 -0500 Subject: [PATCH] feat: tests --- .github/workflows/playwright.yml | 29 ----------------------------- .github/workflows/ui_test.yml | 7 +++++++ playwright.config.ts | 8 +++----- 3 files changed, 10 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/playwright.yml diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index e18764d9..00000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - test: - timeout-minutes: 10 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install dependencies - run: yarn - - name: Install Playwright Browsers - run: yarn playwright:install - - name: Run Playwright tests - run: yarn playwright:test - env: - VITE_PROJECT_ID: ${{ secrets.VITE_DEV_PROJECT_ID }} - - uses: actions/upload-artifact@v3 - if: always() - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 diff --git a/.github/workflows/ui_test.yml b/.github/workflows/ui_test.yml index 12444281..60d42699 100644 --- a/.github/workflows/ui_test.yml +++ b/.github/workflows/ui_test.yml @@ -4,6 +4,13 @@ on: branches: [ main ] pull_request: branches: [ main ] +concurrency: + # Support push/pr as event types with different behaviors each: + # 1. push: queue up builds + # 2. pr: only allow one run per PR + group: ${{ github.workflow }}-${{ github.event.type }}${{ github.event.pull_request.number }} + # If there is already a workflow running for the same pull request, cancel it + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: test: timeout-minutes: 10 diff --git a/playwright.config.ts b/playwright.config.ts index ebe6ae70..8d7fb042 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -17,19 +17,17 @@ export default defineConfig({ /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + retries: 0, + /* Parallel tests currently blocked. */ + workers: 1, /* 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. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ baseURL, - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: 'on-first-retry', - screenshot: 'only-on-failure', video: 'retain-on-failure' },