@samitouri / QOS-React / commits / dd8552ae0d

yarn test: Default to bleeding edge configuration (#21238)

My personal workflow is to develop against the www-modern release channel, with the variant flags enabled, because it encompasses the largest set of features. Then I rely on CI to run the tests against all the other configurations. So in practice, I almost always run ``` yarn test -r=www-modern --variant TEST_FILE ``` instead of ``` yarn test TEST_FILE ``` So, I've updated the `yarn test` command to use those options by default.

Andrew Clark committed Apr 12, 2021 at 11:49 UTC dd8552ae0d82afed66fec649ee5c044c69c65e92
2 files changed +29 -23
.circleci/config.yml
+16 -16
@@ -462,14 +462,14 @@ workflows:
462 - "-r=stable --env=production"
463 - "-r=experimental --env=development"
464 - "-r=experimental --env=production"
465 - - "-r=www-classic --env=development"
466 - - "-r=www-classic --env=production"
467 - - "-r=www-classic --env=development --variant"
468 - - "-r=www-classic --env=production --variant"
469 - - "-r=www-modern --env=development"
470 - - "-r=www-modern --env=production"
471 - - "-r=www-modern --env=development --variant"
472 - - "-r=www-modern --env=production --variant"
465 + - "-r=www-classic --env=development --variant=false"
466 + - "-r=www-classic --env=production --variant=false"
467 + - "-r=www-classic --env=development --variant=true"
468 + - "-r=www-classic --env=production --variant=true"
469 + - "-r=www-modern --env=development --variant=false"
470 + - "-r=www-modern --env=production --variant=false"
471 + - "-r=www-modern --env=development --variant=true"
472 + - "-r=www-modern --env=production --variant=true"
473
474 # TODO: Test more persistent configurations?
475 - '-r=stable --env=development --persistent'
@@ -497,14 +497,14 @@ workflows:
497 - "--project=devtools -r=experimental"
498
499 # TODO: Update test config to support www build tests
500 - # - "-r=www-classic --env=development"
501 - # - "-r=www-classic --env=production"
502 - # - "-r=www-classic --env=development --variant"
503 - # - "-r=www-classic --env=production --variant"
504 - # - "-r=www-modern --env=development"
505 - # - "-r=www-modern --env=production"
506 - # - "-r=www-modern --env=development --variant"
507 - # - "-r=www-modern --env=production --variant"
500 + # - "-r=www-classic --env=development --variant=false"
501 + # - "-r=www-classic --env=production --variant=false"
502 + # - "-r=www-classic --env=development --variant=true"
503 + # - "-r=www-classic --env=production --variant=true"
504 + # - "-r=www-modern --env=development --variant=false"
505 + # - "-r=www-modern --env=production --variant=false"
506 + # - "-r=www-modern --env=development --variant=true"
507 + # - "-r=www-modern --env=production --variant=true"
508
509 # TODO: Test more persistent configurations?
510 - get_base_build:
scripts/jest/jest-cli.js
+13 -7
@@ -44,7 +44,7 @@ const argv = yargs
44 describe: 'Run with the given release channel.',
45 requiresArg: true,
46 type: 'string',
47 - default: 'experimental',
47 + default: 'www-modern',
48 choices: ['experimental', 'stable', 'www-classic', 'www-modern'],
49 },
50 env: {
@@ -71,7 +71,6 @@ const argv = yargs
71 describe: 'Run with www variant set to true.',
72 requiresArg: false,
73 type: 'boolean',
74 - default: false,
74 },
75 build: {
76 alias: 'b',
@@ -161,11 +160,18 @@ function validateOptions() {
160 }
161 }
162
164 - if (argv.variant && !isWWWConfig()) {
165 - logError(
166 - 'Variant is only supported for the www release channels. Update these options to continue.'
167 - );
168 - success = false;
163 + if (isWWWConfig()) {
164 + if (argv.variant === undefined) {
165 + // Turn internal experiments on by default
166 + argv.variant = true;
167 + }
168 + } else {
169 + if (argv.variant) {
170 + logError(
171 + 'Variant is only supported for the www release channels. Update these options to continue.'
172 + );
173 + success = false;
174 + }
175 }
176
177 if (argv.build && argv.persistent) {