Skip to content

Commit

Permalink
Update packages to playwright test provider, updated browser workflow…
Browse files Browse the repository at this point in the history
… file
  • Loading branch information
holgerd77 committed Jun 21, 2023
1 parent 101578e commit 1e1bdf8
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 20 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@ jobs:
- run: cd ../rlp && npm run test:browser
- run: cd ../util && npm run test:browser
- run: cd ../common && npm run test:browser
# Trie currently hangs (no test execution)
# Trie: several tests not passing yet
# - run: cd ../trie && npm run test:browser
# See vitest.config.browser.ts for exclusions
- run: cd ../tx && npm run test:browser

# Block: serveral tests not passing yet
# - run: cd ../block && npm run test:browser
# No browser tests for devp2p
# Blockchain: strange errors, needs another look
# - run: cd ../blockchain && npm run test:browser
# No browser tests for ethash
# EVM: several tests not passing yet
# - run: cd ../evm && npm run test:browser
# StateManager: selected tests not passing yet
# - run: cd ../statemanager && npm run test:browser
# Wallet: import failing
# - run: cd ../wallet && npm run test:browser
# VM: several tests not passing yet
# - run: cd ../vm && npm run test:browser

3 changes: 1 addition & 2 deletions packages/block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"author": "mjbecze (mb@ethdev.com)",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand All @@ -39,7 +38,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/blockchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"author": "mjbecze <mjbecze@gmail.com>",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand All @@ -39,7 +38,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"contributors": [
"Alex Beregszaszi <alex@rtfs.hu>"
],
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
Expand All @@ -47,7 +46,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"profiling": "0x ./benchmarks/run.js profiling",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rlp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/statemanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"contributors": [
"g11tech <gajinder@g11.in>"
],
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
Expand All @@ -42,7 +41,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh && npm run test:node",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/trie/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"prepublishOnly": "../../config/cli/prepublish.sh",
"profiling": "tsc --target ES5 benchmarks/random.ts && 0x benchmarks/random.js",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"hireable": true
}
],
"type": "module",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
Expand All @@ -51,7 +50,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --config=./vitest.config.browser.ts --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --config=./vitest.config.browser.ts --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "npx vitest run --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run --config=./vitest.config.browser.ts --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "npx vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down
11 changes: 11 additions & 0 deletions packages/util/vitest.config.browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configDefaults, defineConfig } from 'vitest/config'

export default defineConfig({
test: {
exclude: [
...configDefaults.exclude,
// access control
'test/provider.spec.ts',
],
},
})
3 changes: 2 additions & 1 deletion packages/vm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"contributors": [
"Alex Beregszaszi <alex@rtfs.hu>"
],
"type": "commonjs",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"exports": {
Expand Down Expand Up @@ -48,7 +49,7 @@
"profiling": "0x ./benchmarks/run.js profiling",
"test": "echo \"[INFO] Generic test cmd not used. See package.json for more specific test run cmds.\"",
"test:API": "npx vitest run ./test/api/",
"test:browser": "npx vitest run ./test/api/**/*.spec.ts --browser.name=chrome --browser.headless",
"test:browser": "npx vitest run ./test/api/**/*.spec.ts --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:blockchain": "npm run tester -- --blockchain",
"test:blockchain:allForks": "echo 'Chainstart Homestead dao TangerineWhistle SpuriousDragon Byzantium Constantinople Petersburg Istanbul MuirGlacier Berlin London ByzantiumToConstantinopleFixAt5 EIP158ToByzantiumAt5 FrontierToHomesteadAt5 HomesteadToDaoAt5 HomesteadToEIP150At5 BerlinToLondonAt5' | xargs -n1 | xargs -I v1 npm run tester -- --blockchain --fork=v1 --verify-test-amount-alltests",
"test:blockchain:transitionForks": "echo 'ByzantiumToConstantinopleFixAt5 EIP158ToByzantiumAt5 FrontierToHomesteadAt5 HomesteadToDaoAt5 HomesteadToEIP150At5 BerlinToLondonAt5' | xargs -n1 | xargs -I v1 npm run tester -- --blockchain --fork=v1 --verify-test-amount-alltests",
Expand Down
3 changes: 1 addition & 2 deletions packages/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"author": "Alex Beregszaszi <alex@rtfs.hu>",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"type": "module",
"exports": {
".": {
"import": "./dist/esm/index.js",
Expand All @@ -40,7 +39,7 @@
"lint:fix": "../../config/cli/lint-fix.sh",
"prepublishOnly": "../../config/cli/prepublish.sh",
"test": "npm run test:node && npm run test:browser",
"test:browser": "vitest run --browser.name=chrome --browser.headless",
"test:browser": "vitest run --browser.name=webkit --browser.provider=playwright --browser.headless",
"test:node": "vitest run",
"tsc": "../../config/cli/ts-compile.sh"
},
Expand Down

0 comments on commit 1e1bdf8

Please sign in to comment.