Skip to content

Commit

Permalink
chore: separate out cross-browser tests (#8585)
Browse files Browse the repository at this point in the history
* chore: separate out cross-browser tests

* format

* move files, remove filters

* i think this should work?

* grrrr

* fixes

* fixes

* setup

* run entire suite on node 18/chromium/ubuntu

* tidy up

* remove node 18 cross-browser tests

* depend on test/**

Co-authored-by: Rich Harris <hello@rich-harris.dev>
  • Loading branch information
benmccann and Rich-Harris authored Jan 19, 2023
1 parent c143c5e commit 5805356
Show file tree
Hide file tree
Showing 10 changed files with 1,744 additions and 1,687 deletions.
46 changes: 39 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,51 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [16]
os: [ubuntu-latest, windows-latest]
e2e-browser: ['chromium']
include:
- node-version: 16
os: [ubuntu-latest, windows-latest]
e2e-browser: 'chromium'
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
env:
TURBO_CACHE_KEY: ${{ matrix.os }}-${{ matrix.node-version }}
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm test
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
path: test-results.tar.gz
Cross-browser-test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: 16
os: ubuntu-latest
e2e-browser: 'firefox'
- node-version: 16
os: macOS-latest
e2e-browser: 'webkit'
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
env:
TURBO_CACHE_KEY: ${{ matrix.os }}-${{ matrix.node-version }}
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
Expand All @@ -64,7 +96,7 @@ jobs:
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm test
- run: pnpm test:cross-browser
- name: Archive test results
if: failure()
shell: bash
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"private": true,
"scripts": {
"test": "turbo run test --filter=./packages/*",
"test:cross-browser": "turbo run test:cross-browser --filter=./packages/*",
"test:vite-ecosystem-ci": "pnpm test --dir packages/kit",
"check": "turbo run check",
"lint": "turbo run lint",
Expand Down
1 change: 1 addition & 0 deletions packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"format": "pnpm lint --write",
"test": "pnpm test:unit && pnpm test:integration",
"test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test",
"test:cross-browser": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-browser",
"test:unit": "uvu src \"(spec\\.js|test[\\\\/]index\\.js)\"",
"postinstall": "node postinstall.js"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/kit/test/apps/basics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
"check": "svelte-kit sync && tsc && svelte-check",
"test": "node test/setup.js && pnpm test:dev && pnpm test:build",
"test:dev": "rimraf test/errors.json && cross-env DEV=true playwright test",
"test:build": "rimraf test/errors.json && playwright test"
"test:build": "rimraf test/errors.json && playwright test",
"test:cross-browser": "npm run test:cross-browser:dev && npm run test:cross-browser:build",
"test:cross-browser:dev": "node test/setup.js && rimraf test/errors.json && cross-env DEV=true playwright test test/cross-browser/",
"test:cross-browser:build": "node test/setup.js && rimraf test/errors.json && playwright test test/cross-browser/"
},
"devDependencies": {
"@sveltejs/kit": "workspace:^",
Expand Down
Loading

0 comments on commit 5805356

Please sign in to comment.