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

Split karma testing into more CI containers #3638

Merged
merged 2 commits into from
Jul 1, 2019
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
40 changes: 35 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,24 @@ jobs:
docker: *docker-node-browsers
environment:
JUNIT_REPORT_PATH: reports
parallelism: 3
parallelism: 6
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir ./reports
- run:
# split karma tests into containers because they can take up a lot of memory
# running them in one container caused Karma to time out frequently
# see https://github.com/palantir/blueprint/issues/3616
command: |
case $CIRCLE_NODE_INDEX in \
0) yarn lerna run --parallel test:pre ;; \
1) yarn lerna run --parallel test:iso ;; \
2) yarn lerna run --parallel test:karma ;; \
0) yarn lerna run --parallel test:typeCheck ;; \
1) yarn lerna run --scope "@blueprintjs/core" test:karma ;; \
2) yarn lerna run --scope "@blueprintjs/datetime" test:karma ;; \
3) yarn lerna run --scope "@blueprintjs/select" test:karma ;; \
4) yarn lerna run --scope "@blueprintjs/table" test:karma ;; \
5) yarn lerna run --scope "@blueprintjs/timezone" test:karma ;; \
esac
when: always
- store_test_results: { path: ./reports }
Expand All @@ -122,6 +128,26 @@ jobs:
JUNIT_REPORT_PATH: reports
REACT: 15 # use React 15 for this job

test-iso-react-16: &test-iso
docker: *docker-node-lts
environment:
JUNIT_REPORT_PATH: reports
steps:
- checkout
- restore_cache: *restore-node-modules-cache
- attach_workspace: { at: '.' }
- run: mkdir ./reports
- run: yarn lerna run --parallel test:iso
- store_test_results: { path: ./reports }
- store_artifacts: { path: ./reports }

test-iso-react-15:
# copy test-iso-react-16 and override environment
<<: *test-iso
environment:
JUNIT_REPORT_PATH: reports
REACT: 15 # use React 15 for this job

deploy-preview:
docker: *docker-node-lts
steps:
Expand Down Expand Up @@ -160,10 +186,14 @@ workflows:
requires: [compile]
- test-react-16:
requires: [compile]
- test-iso-react-15:
requires: [compile]
- test-iso-react-16:
requires: [compile]
- deploy-preview:
requires: [dist]
- deploy-npm:
requires: [dist, lint, test-react-15, test-react-16]
requires: [dist, lint, test-react-15, test-react-16, test-iso-react-15, test-iso-react-16]
filters:
branches:
only:
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso test:karma",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
Expand Down
4 changes: 2 additions & 2 deletions packages/datetime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso test:karma",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
Expand Down
4 changes: 2 additions & 2 deletions packages/icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"verify": "npm-run-all compile -p dist test lint"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/labs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:karma",
"test:typeCheck": "tsc -p ./test",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
"verify": "npm-run-all compile -p dist test lint"
Expand Down
4 changes: 2 additions & 2 deletions packages/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso test:karma",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
Expand Down
4 changes: 2 additions & 2 deletions packages/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso test:karma",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
Expand Down
4 changes: 2 additions & 2 deletions packages/timezone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"lint:scss": "sass-lint",
"lint:ts": "ts-lint",
"lint-fix": "ts-lint --fix",
"test": "run-s test:pre test:iso test:karma",
"test:pre": "tsc -p ./test",
"test": "run-s test:typeCheck test:iso test:karma",
"test:typeCheck": "tsc -p ./test",
"test:iso": "mocha test/isotest.js",
"test:karma": "karma start",
"test:karma:debug": "karma start --single-run=false --reporters=mocha --debug",
Expand Down