Skip to content

Commit

Permalink
test: optimize test runner for e2e-tests and ci (#1142)
Browse files Browse the repository at this point in the history
* test: optimize jest performance

* add test:ci
  • Loading branch information
TarikGul committed Nov 24, 2022
1 parent 17f00d6 commit f635d59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
run: yarn install

- name: Unit tests.
run: yarn test
run: yarn test:ci

build:
# The type of runner that the job will run on
Expand Down
8 changes: 8 additions & 0 deletions e2e-tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ const base = require('@substrate/dev/config/jest')
module.exports = {
...base,
testPathIgnorePatterns: ['/build/', '/node_modules/', '/src/'],
testEnvironment: 'node',
maxConcurrency: 3,
maxWorkers: '50%',
globals: {
'ts-jest': {
isloatedModules: true
}
}
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"dev": "tsc-watch --onSuccess \"yarn run main\"",
"test": "NODE_ENV=test substrate-exec-jest --detectOpenHandles",
"test:watch": "NODE_ENV=test substrate-exec-jest --watch",
"test:ci": "NODE_ENV=test substrate-exec-jest --runInBand",
"lint:e2e-tests": "cd e2e-tests && substrate-dev-run-lint",
"build:e2e-tests": "substrate-exec-tsc --project e2e-tests/tsconfig.json",
"test:e2e-tests": "yarn build:e2e-tests && node ./e2e-tests/build/index.js --config=./e2e-tests/jest.config.js",
Expand Down

0 comments on commit f635d59

Please sign in to comment.