Skip to content

Commit

Permalink
Add new test cli (facebook#19184)
Browse files Browse the repository at this point in the history
* Add new test cli

* Remove --variant accidentally added to test-persist

* s/test/tests

* Updates from review

* Update package.json tests

* Missed a release channel in circle.yaml

* Update config.yml to use just run: with test commands

* Update release-channel options and add build dir checks

* Update test args to use the new release-channel options

* Fix error in circle config.yml

* Fix a wrong condition for the --variant check

* Fix a wrong condition for the --persistent check

* Prettier

* Require build check for devtool tests as well
  • Loading branch information
rickhanlonii committed Jun 26, 2020
1 parent 7d0e415 commit 72bbcad
Show file tree
Hide file tree
Showing 5 changed files with 374 additions and 98 deletions.
94 changes: 20 additions & 74 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test --maxWorkers=2
- run: yarn test --release-channel=stable --ci

yarn_test:
docker: *docker
Expand All @@ -109,10 +106,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test --maxWorkers=2
- run: yarn test --ci

RELEASE_CHANNEL_stable_yarn_test_www:
docker: *docker
Expand All @@ -121,10 +115,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-www --maxWorkers=2
- run: yarn test --release-channel=www-classic --ci

RELEASE_CHANNEL_stable_yarn_test_www_variant:
docker: *docker
Expand All @@ -133,10 +124,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-www-variant --maxWorkers=2
- run: yarn test --release-channel=www-classic --variant --ci

RELEASE_CHANNEL_stable_yarn_test_prod_www:
docker: *docker
Expand All @@ -145,10 +133,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-prod-www --maxWorkers=2
- run: yarn test --release-channel=www-classic --prod --ci

RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
docker: *docker
Expand All @@ -157,10 +142,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-prod-www-variant --maxWorkers=2
- run: yarn test --release-channel=www-classic --prod --variant --ci

yarn_test_www:
docker: *docker
Expand All @@ -169,10 +151,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-www --maxWorkers=2
- run: yarn test --release-channel=www-modern --ci

yarn_test_www_variant:
docker: *docker
Expand All @@ -181,10 +160,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-www-variant --maxWorkers=2
- run: yarn test --release-channel=www-modern --variant --ci

yarn_test_prod_www:
docker: *docker
Expand All @@ -193,10 +169,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-prod-www --maxWorkers=2
- run: yarn test --release-channel=www-modern --prod --ci

yarn_test_prod_www_variant:
docker: *docker
Expand All @@ -205,10 +178,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-prod-www-variant --maxWorkers=2
- run: yarn test --release-channel=www-modern --prod --variant --ci

RELEASE_CHANNEL_stable_yarn_test_persistent:
docker: *docker
Expand All @@ -218,10 +188,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-persistent --maxWorkers=2
- run: yarn test --release-channel=stable --persistent --ci

RELEASE_CHANNEL_stable_yarn_test_prod:
docker: *docker
Expand All @@ -231,10 +198,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-prod --maxWorkers=2
- run: yarn test --release-channel=stable --prod --ci

yarn_test_prod:
docker: *docker
Expand All @@ -243,10 +207,7 @@ jobs:
- checkout
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-prod --maxWorkers=2
- run: yarn test --release-channel=experimental --prod --ci

RELEASE_CHANNEL_stable_yarn_build:
docker: *docker
Expand Down Expand Up @@ -388,10 +349,7 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-build --maxWorkers=2
- run: yarn test --release-channel=stable --build --ci

yarn_test_build:
docker: *docker
Expand All @@ -401,10 +359,7 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-build --maxWorkers=2
- run: yarn test --release-channel=experimental --build --ci

yarn_test_build_devtools:
docker: *docker
Expand All @@ -414,10 +369,7 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-build-devtools --maxWorkers=2
- run: yarn test --project=devtools --build --ci

RELEASE_CHANNEL_stable_yarn_test_dom_fixtures:
docker: *docker
Expand Down Expand Up @@ -446,8 +398,8 @@ jobs:
- run:
name: Run fuzz tests
command: |
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --maxWorkers=2
FUZZ_TEST_SEED=$RANDOM yarn test-prod fuzz --maxWorkers=2
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci
RELEASE_CHANNEL_stable_yarn_test_build_prod:
docker: *docker
Expand All @@ -457,10 +409,7 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: stable
command: yarn test-build-prod --maxWorkers=2
- run: yarn test --release-channel=stable --build --prod --ci

yarn_test_build_prod:
docker: *docker
Expand All @@ -470,10 +419,7 @@ jobs:
- attach_workspace: *attach_workspace
- *restore_yarn_cache
- *run_yarn
- run:
environment:
RELEASE_CHANNEL: experimental
command: yarn test-build-prod --maxWorkers=2
- run: yarn test --release-channel=experimental --build --prod --ci

workflows:
version: 2
Expand Down
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"core-js": "^3.6.4",
"coveralls": "^3.0.9",
"create-react-class": "^15.6.3",
"cross-env": "^6.0.3",
"danger": "^9.2.10",
"error-stack-parser": "^2.0.6",
"eslint": "^7.0.0",
Expand All @@ -65,6 +64,7 @@
"gzip-size": "^5.1.1",
"jasmine-check": "^1.0.0-rc.0",
"jest": "^25.2.7",
"jest-cli": "^25.2.7",
"jest-diff": "^25.2.6",
"jest-snapshot-serializer-raw": "^1.1.0",
"minimatch": "^3.0.4",
Expand All @@ -90,7 +90,8 @@
"through2": "^3.0.1",
"tmp": "^0.1.0",
"typescript": "^3.7.5",
"webpack": "^4.41.2"
"webpack": "^4.41.2",
"yargs": "^15.3.1"
},
"devEngines": {
"node": "8.x || 9.x || 10.x || 11.x || 12.x || 13.x || 14.x"
Expand All @@ -106,21 +107,21 @@
"lint-build": "node ./scripts/rollup/validate/index.js",
"extract-errors": "yarn build --type=dev --extract-errors",
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js && node ./scripts/yarn/downloadReactIsForPrettyFormat.js",
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source.js --runInBand",
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
"test-www": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-www.js",
"test-www-variant": "cross-env NODE_ENV=development VARIANT=true jest --config ./scripts/jest/config.source-www.js",
"test-prod-www": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source-www.js",
"test-prod-www-variant": "cross-env NODE_ENV=production VARIANT=true jest --config ./scripts/jest/config.source-www.js",
"test-persistent": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-persistent.js",
"debug-test-persistent": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source-persistent.js --runInBand",
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
"debug-test-prod": "cross-env NODE_ENV=production node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.source.js --runInBand",
"test-prod-build": "yarn test-build-prod",
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
"test-build-devtools": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build-devtools.js",
"debug-test-build-devtools": "cross-env NODE_ENV=development node --inspect-brk node_modules/jest/bin/jest.js --config ./scripts/jest/config.build-devtools.js",
"debug-test": "yarn test --debug",
"test": "node ./scripts/jest/jest-cli.js",
"test-www": "yarn test --release-channel=www-modern",
"test-www-variant": "yarn test --release-channel=www-modern --variant",
"test-prod-www": "yarn test --prod --release-channel=www-modern",
"test-prod-www-variant": "yarn test --prod --release-channel=www-modern --variant",
"test-persistent": "yarn test --persistent",
"debug-test-persistent": "yarn test --debug --persistent",
"test-prod": "yarn test --prod",
"debug-test-prod": "yarn test --debug --prod",
"test-prod-build": "yarn test --prod --build",
"test-build": "yarn test --build",
"test-build-prod": "yarn test --build --prod",
"test-build-devtools": "yarn test --build --project devtools",
"debug-test-build-devtools": "yarn test --debug --build --project devtools",
"test-dom-fixture": "cd fixtures/dom && yarn && yarn prestart && yarn test",
"flow": "node ./scripts/tasks/flow.js",
"flow-ci": "node ./scripts/tasks/flow-ci.js",
Expand Down
Loading

0 comments on commit 72bbcad

Please sign in to comment.