Skip to content

Commit

Permalink
yarn test: Default to bleeding edge configuration (facebook#21238)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
acdlite authored and koto committed Jun 15, 2021
1 parent fea2a7d commit 06f92da
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
32 changes: 16 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,14 @@ workflows:
- "-r=stable --env=production"
- "-r=experimental --env=development"
- "-r=experimental --env=production"
- "-r=www-classic --env=development"
- "-r=www-classic --env=production"
- "-r=www-classic --env=development --variant"
- "-r=www-classic --env=production --variant"
- "-r=www-modern --env=development"
- "-r=www-modern --env=production"
- "-r=www-modern --env=development --variant"
- "-r=www-modern --env=production --variant"
- "-r=www-classic --env=development --variant=false"
- "-r=www-classic --env=production --variant=false"
- "-r=www-classic --env=development --variant=true"
- "-r=www-classic --env=production --variant=true"
- "-r=www-modern --env=development --variant=false"
- "-r=www-modern --env=production --variant=false"
- "-r=www-modern --env=development --variant=true"
- "-r=www-modern --env=production --variant=true"

# TODO: Test more persistent configurations?
- '-r=stable --env=development --persistent'
Expand Down Expand Up @@ -497,14 +497,14 @@ workflows:
- "--project=devtools -r=experimental"

# TODO: Update test config to support www build tests
# - "-r=www-classic --env=development"
# - "-r=www-classic --env=production"
# - "-r=www-classic --env=development --variant"
# - "-r=www-classic --env=production --variant"
# - "-r=www-modern --env=development"
# - "-r=www-modern --env=production"
# - "-r=www-modern --env=development --variant"
# - "-r=www-modern --env=production --variant"
# - "-r=www-classic --env=development --variant=false"
# - "-r=www-classic --env=production --variant=false"
# - "-r=www-classic --env=development --variant=true"
# - "-r=www-classic --env=production --variant=true"
# - "-r=www-modern --env=development --variant=false"
# - "-r=www-modern --env=production --variant=false"
# - "-r=www-modern --env=development --variant=true"
# - "-r=www-modern --env=production --variant=true"

# TODO: Test more persistent configurations?
- get_base_build:
Expand Down
20 changes: 13 additions & 7 deletions scripts/jest/jest-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const argv = yargs
describe: 'Run with the given release channel.',
requiresArg: true,
type: 'string',
default: 'experimental',
default: 'www-modern',
choices: ['experimental', 'stable', 'www-classic', 'www-modern'],
},
env: {
Expand All @@ -71,7 +71,6 @@ const argv = yargs
describe: 'Run with www variant set to true.',
requiresArg: false,
type: 'boolean',
default: false,
},
build: {
alias: 'b',
Expand Down Expand Up @@ -161,11 +160,18 @@ function validateOptions() {
}
}

if (argv.variant && !isWWWConfig()) {
logError(
'Variant is only supported for the www release channels. Update these options to continue.'
);
success = false;
if (isWWWConfig()) {
if (argv.variant === undefined) {
// Turn internal experiments on by default
argv.variant = true;
}
} else {
if (argv.variant) {
logError(
'Variant is only supported for the www release channels. Update these options to continue.'
);
success = false;
}
}

if (argv.build && argv.persistent) {
Expand Down

0 comments on commit 06f92da

Please sign in to comment.