chore: use circleci timings split for e2e tests (#18367)

This commit is contained in:
Zach Bloomquist
2021-10-07 15:25:51 +00:00
committed by GitHub
parent e9188669da
commit b3aae8e1ca
157 changed files with 19 additions and 6 deletions

View File

@@ -425,7 +425,20 @@ commands:
steps:
- restore_cached_workspace
- run:
command: yarn workspace @packages/server test ./test/e2e/$(( $CIRCLE_NODE_INDEX ))_*spec* --browser <<parameters.browser>>
command: |
ALL_SPECS=`circleci tests glob "/root/cypress/packages/server/test/e2e/*spec*"`
SPECS=
for file in $ALL_SPECS; do
# filter out non_root tests, they have their own stage
if [[ "$file" == *"non_root"* ]]; then
echo "Skipping $file"
continue
fi
SPECS="$SPECS $file"
done
SPECS=`echo $SPECS | xargs -n 1 | circleci tests split --split-by=timings`
echo SPECS=$SPECS
yarn workspace @packages/server test $SPECS --browser <<parameters.browser>>
- verify-mocha-results
- store_test_results:
path: /tmp/cypress

View File

@@ -73,12 +73,12 @@ yarn test-integration cli_spec ## shorthand, uses globbing to find spec
yarn test <path/to/test>
yarn test test/e2e/1_async_timeouts_spec.js
## or
yarn test-e2e 1_async ## shorthand, uses globbing to find spec
yarn test-e2e async_timeouts ## shorthand, uses globbing to find spec
```
To keep the browser open after a spec run (for easier debugging and iterating on specs), you can pass the `--no-exit` flag to the e2e test command. Live reloading due to spec changes should also work:
```sh
yarn test test/e2e/2_go_spec.js --browser chrome --no-exit
yarn test test/e2e/go_spec.js --browser chrome --no-exit
```
### Updating snaphots
@@ -88,5 +88,5 @@ Prepend `SNAPSHOT_UPDATE=1` to any test command. See [`snap-shot-it` instruction
```bash
SNAPSHOT_UPDATE=1 yarn test test/unit/api_spec.js
SNAPSHOT_UPDATE=1 yarn test test/integration/cli_spec.js
SNAPSHOT_UPDATE=1 yarn test-e2e 1_async
SNAPSHOT_UPDATE=1 yarn test-e2e async_timeout
```

View File

@@ -144,7 +144,7 @@ foo\
const haveRoot = !process.env.USE_HIGH_PORTS && (process.geteuid() === 0)
if (!haveRoot) {
console.warn('(e2e tests warning) You are not running as root; therefore, 2_cookies_spec cannot cover the case where the default (80/443) HTTP(s) port is used. Alternate ports (2121/2323) will be used instead.')
console.warn('(e2e tests warning) You are not running as root; therefore, cookies_spec cannot cover the case where the default (80/443) HTTP(s) port is used. Alternate ports (2121/2323) will be used instead.')
}
let httpPort = 2121

Some files were not shown because too many files have changed in this diff Show More