Skip to content

Commit

Permalink
chore: use circleci timings split for e2e tests (#18367)
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Oct 7, 2021
1 parent e918866 commit b3aae8e
Show file tree
Hide file tree
Showing 157 changed files with 19 additions and 6 deletions.
15 changes: 14 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// TODO: rename this file to 5_module_api_spec
// TODO: rename this file to module_api_spec

const path = require('path')
const _ = require('lodash')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

4 comments on commit b3aae8e

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b3aae8e Oct 7, 2021

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.6.0/circle-develop-b3aae8e1caa33e0fbb78d3b2929fcfea81362f64/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b3aae8e Oct 7, 2021

Choose a reason for hiding this comment

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

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.6.0/appveyor-develop-b3aae8e1caa33e0fbb78d3b2929fcfea81362f64/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b3aae8e Oct 7, 2021

Choose a reason for hiding this comment

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

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.6.0/appveyor-develop-b3aae8e1caa33e0fbb78d3b2929fcfea81362f64/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b3aae8e Oct 7, 2021

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.6.0/circle-develop-b3aae8e1caa33e0fbb78d3b2929fcfea81362f64/cypress.tgz

Please sign in to comment.