From 880587366d84f9d36dd606088bc7bad050ead77e Mon Sep 17 00:00:00 2001 From: Ricky Date: Wed, 14 Oct 2020 08:54:34 -0400 Subject: [PATCH] Deprecate old test script commands (#19893) * Deprecate old test script commands * Update PR template test script * Add test-stable and test-www-classic * Update circle test names * Rename test-www-classic to test-classic * Missed some job renames * Missed some more job renames --- .circleci/config.yml | 86 ++++++++++++++++---------------- .github/PULL_REQUEST_TEMPLATE.md | 2 +- package.json | 28 ++++++----- scripts/jest/jest-cli.js | 9 ++++ 4 files changed, 68 insertions(+), 57 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 07459b232ab10..d41354116fbef 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,7 @@ 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 @@ -109,7 +109,7 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=stable --ci + - run: yarn test-stable --ci yarn_test: docker: *docker @@ -120,79 +120,79 @@ 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 @@ -200,9 +200,9 @@ jobs: 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 @@ -210,7 +210,7 @@ jobs: steps: - checkout - *restore_node_modules - - run: yarn test --release-channel=stable --prod --ci + - run: yarn test-stable --prod --ci yarn_test_prod: docker: *docker @@ -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 @@ -316,7 +316,7 @@ jobs: root: packages/react-devtools-scheduling-profiler paths: - dist - + deploy_devtools_scheduling_profiler: docker: *docker environment: *environment @@ -389,7 +389,7 @@ 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 @@ -397,7 +397,7 @@ jobs: - 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 @@ -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 @@ -447,7 +447,7 @@ 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 @@ -455,7 +455,7 @@ jobs: - 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 @@ -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 @@ -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: @@ -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: @@ -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: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7759363adb339..11ef400966cd8 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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. diff --git a/package.json b/package.json index 42e625fd6cbd0..64e4430ede0a7 100644 --- a/package.json +++ b/package.json @@ -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'", "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", diff --git a/scripts/jest/jest-cli.js b/scripts/jest/jest-cli.js index 4bd7377134665..19e3879c776a8 100644 --- a/scripts/jest/jest-cli.js +++ b/scripts/jest/jest-cli.js @@ -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) { @@ -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();