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

Deprecate old test script commands #19893

Merged
merged 7 commits into from
Oct 14, 2020
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
86 changes: 43 additions & 43 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ jobs:
- *restore_node_modules
- run: node ./scripts/tasks/flow-ci

RELEASE_CHANNEL_stable_yarn_test:
yarn_test-stable:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM

steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=stable --ci
- run: yarn test-stable --ci

yarn_test:
docker: *docker
Expand All @@ -120,97 +120,97 @@ jobs:
- *restore_node_modules
- run: yarn test --ci

RELEASE_CHANNEL_stable_yarn_test_www:
yarn_test-classic:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-classic --ci
- run: yarn test-classic --ci

RELEASE_CHANNEL_stable_yarn_test_www_variant:
yarn_test-classic_variant:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-classic --variant --ci
- run: yarn test-classic --variant --ci

RELEASE_CHANNEL_stable_yarn_test_prod_www:
yarn_test-classic_prod:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-classic --prod --ci
- run: yarn test-classic --prod --ci

RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
yarn_test-classic_prod_variant:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-classic --prod --variant --ci
- run: yarn test-classic --prod --variant --ci

yarn_test_www:
yarn_test-www:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-modern --ci
- run: yarn test-www --ci

yarn_test_www_variant:
yarn_test-www_variant:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-modern --variant --ci
- run: yarn test-www --variant --ci

yarn_test_prod_www:
yarn_test-www_prod:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-modern --prod --ci
- run: yarn test-www --prod --ci

yarn_test_prod_www_variant:
yarn_test-www_prod_variant:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=www-modern --prod --variant --ci
- run: yarn test-www --prod --variant --ci

RELEASE_CHANNEL_stable_yarn_test_persistent:
yarn_test-stable_persistent:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM

steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=stable --persistent --ci
- run: yarn test-stable --persistent --ci

RELEASE_CHANNEL_stable_yarn_test_prod:
yarn_test-stable_prod:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM

steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=stable --prod --ci
- run: yarn test-stable --prod --ci

yarn_test_prod:
docker: *docker
Expand All @@ -219,7 +219,7 @@ jobs:
steps:
- checkout
- *restore_node_modules
- run: yarn test --release-channel=experimental --prod --ci
- run: yarn test --prod --ci

RELEASE_CHANNEL_stable_yarn_build:
docker: *docker
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
root: packages/react-devtools-scheduling-profiler
paths:
- dist

deploy_devtools_scheduling_profiler:
docker: *docker
environment: *environment
Expand Down Expand Up @@ -389,15 +389,15 @@ jobs:
command: yarn lint-build
- run: scripts/circleci/check_minified_errors.sh

RELEASE_CHANNEL_stable_yarn_test_build:
yarn_test-stable_build:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_node_modules
- run: yarn test --release-channel=stable --build --ci
- run: yarn test-stable --build --ci

yarn_test_build:
docker: *docker
Expand All @@ -407,7 +407,7 @@ jobs:
- checkout
- attach_workspace: *attach_workspace
- *restore_node_modules
- run: yarn test --release-channel=experimental --build --ci
- run: yarn test --build --ci

yarn_test_build_devtools:
docker: *docker
Expand Down Expand Up @@ -447,15 +447,15 @@ jobs:
FUZZ_TEST_SEED=$RANDOM yarn test fuzz --ci
FUZZ_TEST_SEED=$RANDOM yarn test --prod fuzz --ci

RELEASE_CHANNEL_stable_yarn_test_build_prod:
yarn_test-stable_build_prod:
docker: *docker
environment: *environment
parallelism: *TEST_PARALLELISM
steps:
- checkout
- attach_workspace: *attach_workspace
- *restore_node_modules
- run: yarn test --release-channel=stable --build --prod --ci
- run: yarn test-stable --build --prod --ci

yarn_test_build_prod:
docker: *docker
Expand All @@ -465,7 +465,7 @@ jobs:
- checkout
- attach_workspace: *attach_workspace
- *restore_node_modules
- run: yarn test --release-channel=experimental --build --prod --ci
- run: yarn test --build --prod --ci

workflows:
version: 2
Expand All @@ -478,25 +478,25 @@ workflows:
- yarn_flow:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test:
- yarn_test-stable:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod:
- yarn_test-stable_prod:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_persistent:
- yarn_test-stable_persistent:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_www:
- yarn_test-classic:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_www_variant:
- yarn_test-classic_variant:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod_www:
- yarn_test-classic_prod:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_test_prod_www_variant:
- yarn_test-classic_prod_variant:
requires:
- setup
- RELEASE_CHANNEL_stable_yarn_build:
Expand All @@ -511,10 +511,10 @@ workflows:
- RELEASE_CHANNEL_stable_yarn_lint_build:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_build:
- yarn_test-stable_build:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_build_prod:
- yarn_test-stable_build_prod:
requires:
- RELEASE_CHANNEL_stable_yarn_build
- RELEASE_CHANNEL_stable_yarn_test_dom_fixtures:
Expand All @@ -530,16 +530,16 @@ workflows:
- yarn_test_prod:
requires:
- setup
- yarn_test_www:
- yarn_test-www:
requires:
- setup
- yarn_test_www_variant:
- yarn_test-www_variant:
requires:
- setup
- yarn_test_prod_www:
- yarn_test-www_prod:
requires:
- setup
- yarn_test_prod_www_variant:
- yarn_test-www_prod_variant:
requires:
- setup
- yarn_build:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Run `yarn test-prod` to test in the production environment. It supports the same options as `yarn test`.
5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
Expand Down
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,23 @@
"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": "yarn test --debug",
"debug-test": "yarn test --deprecated '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-stable": "node ./scripts/jest/jest-cli.js --release-channel=stable",
"test-www": "node ./scripts/jest/jest-cli.js --release-channel=www-modern",
"test-classic": "node ./scripts/jest/jest-cli.js --release-channel=www-classic",
"test-www-variant": "yarn test --deprecated 'yarn test-www --variant'",
"test-prod-www": "yarn test --deprecated 'yarn test-www --prod'",
"test-prod-www-variant": "yarn test --deprecated 'yarn test-www --prod --variant'",
"test-persistent": "yarn test --deprecated 'yarn test --persistent'",
"debug-test-persistent": "yarn test --deprecated 'yarn test --debug --persistent'",
"test-prod": "yarn test --deprecated 'yarn test --prod'",
"debug-test-prod": "yarn test --deprecated 'yarn test --debug --prod'",
"test-prod-build": "yarn test --deprecated 'yarn test --prod --build'",
"test-build": "yarn test --deprecated 'yarn test --build'",
"test-build-prod": "yarn test --deprecated 'yarn test --build --prod'",
"test-build-devtools": "yarn test --build --project devtools",
"debug-test-build-devtools": "yarn test --debug --build --project devtools",
"debug-test-build-devtools": "yarn test --deprecated 'yarn test-build-devtools --debug'",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the end we'll have three base test commands:

  • test
  • test-www
  • test-build-devtools

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we already only have three commands since the aliases proxy to them.

"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
9 changes: 9 additions & 0 deletions scripts/jest/jest-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const argv = yargs
type: 'boolean',
default: false,
},
deprecated: {
describe: 'Print deprecation message for command.',
requiresArg: true,
type: 'string',
},
}).argv;

function logError(message) {
Expand Down Expand Up @@ -287,6 +292,10 @@ function getEnvars() {
}

function main() {
if (argv.deprecated) {
console.log(chalk.red(`\nPlease run: \`${argv.deprecated}\` instead.\n`));
return;
}
validateOptions();
const args = getCommandArgs();
const envars = getEnvars();
Expand Down