Skip to content

Commit

Permalink
👷 ci: Use self-hosted runner for E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
duckception committed Nov 30, 2023
1 parent 96c800d commit fbb44b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

test-e2e-headful:
name: Run E2E tests (headful)
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v3

Expand All @@ -38,13 +38,11 @@ jobs:
- name: Install browsers for Playwright
run: pnpm dlx playwright install chromium

- name: Build project
run: pnpm run build

- name: Install linux dependencies
run: |
sudo apt-get install --no-install-recommends -y \
xvfb
# Skipping this for now, `xvfb` is already installed on the self-hosted runner.
#- name: Install linux dependencies
# run: |
# sudo apt-get install --no-install-recommends -y \
# xvfb

- name: Build project
run: pnpm run build
Expand All @@ -53,9 +51,10 @@ jobs:
run: |
pnpm run serve:test-dapp &
# We have to use a force flag here because the cache is not invalidated each run.
- name: Build cache
run: |
xvfb-run pnpm run build:cache
xvfb-run pnpm run build:cache -- --force
- name: Run E2E tests (headful)
run: |
Expand Down
8 changes: 5 additions & 3 deletions wallets/metamask/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ export default defineConfig({
// Run all tests in parallel.
fullyParallel: true,

retries: process.env.CI ? 1 : 0,

// Fail the build on CI if you accidentally left test.only in the source code.
forbidOnly: !!process.env.CI,

// Fail all remaining tests on CI after the first failure. We want to reduce the feedback loop on CI to minimum.
maxFailures: process.env.CI ? 1 : 0,
maxFailures: process.env.CI ? 0 : 0,

// Opt out of parallel tests on CI since it supports only 1 worker.
workers: process.env.CI ? 1 : undefined,
workers: process.env.CI ? 3 : undefined,

// Concise 'dot' for CI, default 'html' when running locally.
// See https://playwright.dev/docs/test-reporters.
Expand All @@ -37,7 +39,7 @@ export default defineConfig({

// Collect all traces on CI, and only traces for failed tests when running locally.
// See https://playwright.dev/docs/trace-viewer.
trace: process.env.CI ? 'on' : 'retain-on-failure'
trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure'
},

// Configure projects for major browsers.
Expand Down

0 comments on commit fbb44b7

Please sign in to comment.