Skip to content

Commit

Permalink
Switch from karma to web-test-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed May 20, 2024
1 parent f26c85a commit 86c4ac7
Show file tree
Hide file tree
Showing 38 changed files with 2,060 additions and 1,386 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,37 @@ on:
branches: [main]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

jobs:
test:
name: JS
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
browser: [chrome-headless, firefox-headless, webkit-headless]
exclude:
# Playwright webkit binary is not compatible with ubuntu
- os: ubuntu-latest
browser: webkit-headless
browser: [chrome, firefox, webkit]
# exclude:
# # Playwright webkit binary is not compatible with ubuntu
# - os: ubuntu-latest
# browser: webkit
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Set up browser cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ matrix.os }}-${{ matrix.browser }}-${{ hashFiles('./yarn.lock') }}

- name: Install dependencies
shell: bash
run: |
Expand All @@ -34,7 +48,7 @@ jobs:
run: |
set -eux
yarn build
yarn build:test
yarn playwright install ${{ matrix.browser }}
- name: Run Tests
run: |
Expand All @@ -43,9 +57,6 @@ jobs:
build:
runs-on: ubuntu-latest

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand All @@ -55,7 +66,7 @@ jobs:
with:
path: |
${{ github.workspace }}/pw-browsers
key: ubuntu-latest-${{ hashFiles('./yarn.lock') }}
key: ubuntu-latest-chromium-${{ hashFiles('./yarn.lock') }}

- name: Install dependencies
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion examples/example-dockpanel-amd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.29.0"
"@playwright/test": "^1.44.0"
}
}
2 changes: 1 addition & 1 deletion examples/example-dockpanel-iife/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.29.0"
"@playwright/test": "^1.44.0"
}
}
2 changes: 1 addition & 1 deletion examples/example-nested-dockpanel-amd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "^1.29.0"
"@playwright/test": "^1.44.0"
}
}
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"clean": "lerna run clean",
"clean:examples": "lerna run clean --scope \"@lumino/example-*\"",
"clean:src": "lerna run clean --scope \"@lumino/!(test-|example-)*\"",
"clean:tests": "lerna run clean:tests",
"clean:test": "lerna run clean:test",
"predocs": "lerna run build:src",
"docs": "typedoc",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx --cache --fix .",
Expand All @@ -31,14 +31,11 @@
"prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
"publish": "npm run clean && npm run build:dist && node scripts/tag-versions.js && lerna publish --yes -m \"Publish\" from-package",
"remove:dependency": "remove-dependency",
"test": "lerna run test --scope \"@lumino/!(example-)*\"",
"test:chrome": "lerna run test:chrome",
"test:chrome-headless": "lerna run test:chrome-headless",
"test": "lerna run test --concurrency 1 --scope \"@lumino/!(example-)*\"",
"test:chrome": "lerna run test:chrome --concurrency 1",
"test:examples": "lerna run test --scope \"@lumino/example-*\"",
"test:firefox": "lerna run test:firefox",
"test:firefox-headless": "lerna run test:firefox-headless",
"test:firefox": "lerna run test:firefox --concurrency 1",
"test:webkit": "lerna run test:webkit --concurrency 1",
"test:webkit-headless": "lerna run test:webkit-headless --concurrency 1",
"update:dependency": "update-dependency --lerna",
"update:versions": "lerna version --no-push --no-git-tag-version",
"prepare": "husky install"
Expand Down
23 changes: 8 additions & 15 deletions packages/algorithm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@
"build": "npm run build:src && rollup -c",
"build:src": "tsc --build",
"build:test": "npm run clean:test && tsc --build tests && cd tests && rollup -c",
"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",
"clean": "rimraf ./lib *.tsbuildinfo ./types ./dist",
"clean:test": "rimraf tests/lib tests/tsconfig.tsbuildinfo",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"test": "npm run test:firefox-headless",
"test:chrome": "cd tests && karma start --browsers=Chrome",
"test:chrome-headless": "cd tests && karma start --browsers=ChromeHeadless",
"test:firefox": "cd tests && karma start --browsers=Firefox",
"test:firefox-headless": "cd tests && yarn karma start --browsers=FirefoxHeadless",
"test:webkit": "cd tests && karma start --browsers=Webkit",
"test:webkit-headless": "cd tests && karma start --browsers=WebkitHeadless",
"test": "npm run build:test && web-test-runner tests/lib/bundle.test.js --node-resolve --playwright",
"test:debug": "npm run test -- --manual --open",
"test:chrome": "npm run test -- --browsers chromium",
"test:firefox": "npm run test -- --browsers firefox",
"test:webkit": "npm run test -- --browsers webkit",
"watch": "tsc --build --watch"
},
"devDependencies": {
Expand All @@ -46,15 +44,10 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^4.3.4",
"@types/mocha": "^2.2.39",
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.3.4",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webkit-launcher": "^1.0.2",
"mocha": "^9.0.3",
"playwright": "^1.35.0",
"postcss": "^8.4.24",
"rimraf": "^5.0.1",
"rollup": "^3.25.1",
Expand Down
24 changes: 0 additions & 24 deletions packages/algorithm/tests/karma.conf.js

This file was deleted.

23 changes: 8 additions & 15 deletions packages/application/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@
"build": "npm run build:src && rollup -c",
"build:src": "tsc --build",
"build:test": "npm run clean:test && tsc --build tests && cd tests && rollup -c",
"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",
"clean": "rimraf ./lib *.tsbuildinfo ./types ./dist",
"clean:test": "rimraf tests/lib tests/tsconfig.tsbuildinfo",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"test": "npm run test:firefox-headless",
"test:chrome": "cd tests && karma start --browsers=Chrome",
"test:chrome-headless": "cd tests && karma start --browsers=ChromeHeadless",
"test:firefox": "cd tests && karma start --browsers=Firefox",
"test:firefox-headless": "cd tests && karma start --browsers=FirefoxHeadless",
"test:webkit": "cd tests && karma start --browsers=Webkit",
"test:webkit-headless": "cd tests && karma start --browsers=WebkitHeadless",
"test": "npm run build:test && web-test-runner tests/lib/bundle.test.js --node-resolve --playwright",
"test:debug": "npm run test -- --manual --open",
"test:chrome": "npm run test -- --browsers chromium",
"test:firefox": "npm run test -- --browsers firefox",
"test:webkit": "npm run test -- --browsers webkit",
"watch": "tsc --build --watch"
},
"dependencies": {
Expand All @@ -51,15 +49,10 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.3.4",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webkit-launcher": "^1.0.2",
"mocha": "^9.0.3",
"playwright": "^1.35.0",
"postcss": "^8.4.24",
"rimraf": "^5.0.1",
"rollup": "^3.25.1",
Expand Down
24 changes: 0 additions & 24 deletions packages/application/tests/karma.conf.js

This file was deleted.

23 changes: 8 additions & 15 deletions packages/collections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@
"build": "npm run build:src && rollup -c",
"build:src": "tsc --build",
"build:test": "npm run clean:test && tsc --build tests && cd tests && rollup -c",
"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",
"clean": "rimraf ./lib *.tsbuildinfo ./types ./dist",
"clean:test": "rimraf tests/lib tests/tsconfig.tsbuildinfo",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"test": "npm run test:firefox-headless",
"test:chrome": "cd tests && karma start --browsers=Chrome",
"test:chrome-headless": "cd tests && karma start --browsers=ChromeHeadless",
"test:firefox": "cd tests && karma start --browsers=Firefox",
"test:firefox-headless": "cd tests && karma start --browsers=FirefoxHeadless",
"test:webkit": "cd tests && karma start --browsers=Webkit",
"test:webkit-headless": "cd tests && karma start --browsers=WebkitHeadless",
"test": "npm run build:test && web-test-runner tests/lib/bundle.test.js --node-resolve --playwright",
"test:debug": "npm run test -- --manual --open",
"test:chrome": "npm run test -- --browsers chromium",
"test:firefox": "npm run test -- --browsers firefox",
"test:webkit": "npm run test -- --browsers webkit",
"watch": "tsc --build --watch"
},
"dependencies": {
Expand All @@ -49,15 +47,10 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.3.4",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webkit-launcher": "^1.0.2",
"mocha": "^9.0.3",
"playwright": "^1.35.0",
"postcss": "^8.4.24",
"rimraf": "^5.0.1",
"rollup": "^3.25.1",
Expand Down
24 changes: 0 additions & 24 deletions packages/collections/tests/karma.conf.js

This file was deleted.

30 changes: 8 additions & 22 deletions packages/commands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,14 @@
"build": "npm run build:src && rollup -c",
"build:src": "tsc --build",
"build:test": "npm run clean:test && tsc --build tests && cd tests && rollup -c",
"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",
"clean": "rimraf ./lib *.tsbuildinfo ./types ./dist",
"clean:test": "rimraf tests/lib tests/tsconfig.tsbuildinfo",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"test": "npm run test:firefox-headless",
"test:chrome": "npm run test:nobrowser -- --browsers=Chrome",
"test:chrome-headless": "npm run test:nobrowser -- --browsers=ChromeHeadless",
"test:debug": "npm run test:debug:firefox",
"test:debug:chrome": "npm run test:debug:nobrowser -- --browsers=Chrome",
"test:debug:chrome-headless": "npm run test:debug:nobrowser -- --browsers=ChromeHeadless",
"test:debug:firefox": "npm run test:debug:nobrowser -- --browsers=Firefox",
"test:debug:firefox-headless": "npm run test:debug:nobrowser -- --browsers=FirefoxHeadless",
"test:debug:nobrowser": "cd tests && karma start --singleRun=false --debug=true --browserNoActivityTimeout=10000000 --browserDisconnectTimeout=10000000",
"test:firefox": "npm run test:nobrowser -- --browsers=Firefox",
"test:firefox-headless": "npm run test:nobrowser -- --browsers=FirefoxHeadless",
"test:webkit": "cd tests && karma start --browsers=Webkit",
"test:webkit-headless": "cd tests && karma start --browsers=WebkitHeadless",
"test:nobrowser": "cd tests && karma start",
"test": "npm run build:test && web-test-runner tests/lib/bundle.test.js --node-resolve --playwright",
"test:debug": "npm run test -- --manual --open",
"test:chrome": "npm run test -- --browsers chrome",
"test:firefox": "npm run test -- --browsers firefox",
"test:webkit": "npm run test -- --browsers webkit",
"watch": "tsc --build --watch"
},
"dependencies": {
Expand All @@ -62,15 +53,10 @@
"@rollup/plugin-node-resolve": "^15.0.1",
"@types/chai": "^3.4.35",
"@types/mocha": "^2.2.39",
"@web/test-runner": "^0.18.2",
"@web/test-runner-playwright": "^0.11.0",
"chai": "^4.3.4",
"karma": "^6.3.4",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^2.1.1",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-webkit-launcher": "^1.0.2",
"mocha": "^9.0.3",
"playwright": "^1.35.0",
"postcss": "^8.4.24",
"rimraf": "^5.0.1",
"rollup": "^3.25.1",
Expand Down
24 changes: 0 additions & 24 deletions packages/commands/tests/karma.conf.js

This file was deleted.

Loading

0 comments on commit 86c4ac7

Please sign in to comment.