Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: separate out cross-browser tests #8585

Merged
merged 12 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
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:
Rich-Harris marked this conversation as resolved.
Show resolved Hide resolved
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",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that writes/package.json also does rimraf test/errors.json despite it only being created in the basics test, so perhaps we could clean remove it from that file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. would love to find a way to not need that errors.json thing, it's super awkward

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if we could put the error on event.locals then return it with the response via a x-error header or something. might try that after we merge this change

"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