Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support test retries #3968

Merged
merged 395 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
395 commits
Select commit Hold shift + click to select a range
6344281
add retries e2e test
kuceb Apr 3, 2020
3523fc8
Merge branch 'server-e2e-tests-allow-watch' into test-retries
kuceb Apr 3, 2020
683a5da
Merge branch 'feature-test-retries' into isolated-runner-fixes
kuceb Apr 3, 2020
140e75d
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Apr 3, 2020
b2b9449
restore runner/test/eslintrc
kuceb Apr 3, 2020
852a36c
use mocha pass event, move runner.spec to runner package
kuceb Apr 3, 2020
62d14b8
fix .eslintignore
kuceb Apr 6, 2020
33ec46b
remove npmInstall logic in helper/e2e script, force custom reporters …
kuceb Apr 6, 2020
e152091
temp 04/09/20 [skip ci]
kuceb Apr 9, 2020
44fdc3b
add retries output to server/reporter, fix mocha pass event order, cl…
kuceb Apr 15, 2020
341cd97
e2e tests - dont run electron tests in other browsers
kuceb Apr 15, 2020
0e21e7a
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Apr 15, 2020
45c8b59
Update readme to reflect how to start server for cypress tests
jennifer-shehane Apr 16, 2020
e85fc68
Merge remote-tracking branch 'origin/develop' into server-e2e-tests-a…
kuceb Apr 20, 2020
a2c40a1
Merge remote-tracking branch 'origin/develop' into server-e2e-tests-a…
kuceb Apr 22, 2020
bd478ed
fix after merge
kuceb Apr 22, 2020
d930174
Merge branch 'server-e2e-tests-allow-watch' into test-retries
kuceb Apr 22, 2020
a0b53ed
fix .coffee -> .js after merge
kuceb Apr 22, 2020
e87d68f
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Apr 22, 2020
a2e00ad
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Apr 23, 2020
5d7f946
fix attempt.tsx
kuceb Apr 23, 2020
fcdc714
fix runnable titles emitted to terminal reporters
kuceb Apr 23, 2020
189948d
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Apr 23, 2020
45e1abc
fix more tests: update snapshots, fix 7_record_spec, 8_reporters_spec
kuceb Apr 23, 2020
d05d907
remove styling for 'attempt-error-region' so it's not indented
jennifer-shehane Apr 24, 2020
8e95c5e
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Apr 24, 2020
2dd7b41
try 2: fix rerun before/after hooks
kuceb Apr 27, 2020
f73126c
Merge remote-tracking branch 'origin/isolated-runner-fixes' into isol…
kuceb Apr 27, 2020
750571e
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Apr 27, 2020
f2dc852
Merge branch 'fix-rerun-hooks-on-navigation' into isolated-runner-fixes
kuceb Apr 27, 2020
6888b20
fix runner with only, runner snapshots, lint fixes
kuceb Apr 28, 2020
5611d2e
Merge remote-tracking branch 'origin/test-retries' into test-retries
kuceb Apr 28, 2020
9bd0a55
temp 04/29/20 [skip ci]
kuceb Apr 29, 2020
44c69ff
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Apr 29, 2020
e282289
backport changes from test-retries
kuceb Apr 29, 2020
85503d3
change logic to rerun before hooks after top navigation
kuceb Apr 30, 2020
46c116d
fix windowSize for browser e2e test
kuceb May 4, 2020
590a573
fix windowSize for xvfb chrome in e2e test
kuceb May 4, 2020
22d2780
ok fine, just disable screenshots
kuceb May 4, 2020
c82fb41
Merge branch '2-fix-rerun-hooks-on-navigation' into isolated-runner-f…
kuceb May 4, 2020
1d54dbd
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 4, 2020
4c88619
fix after merge: decaffed navigation.js
kuceb May 4, 2020
edbf156
update server/unit test snapshots
kuceb May 5, 2020
b13b9de
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 5, 2020
e7068e1
fix after merge: decaffed aliases.js
kuceb May 5, 2020
98408a4
fix usage of cypress --parallel flag in circle.yml
kuceb May 5, 2020
8ea4bbc
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 6, 2020
8d30b64
fix circle.yml integration-tests jobs
kuceb May 6, 2020
63c61a2
fix decaf related typo
kuceb May 6, 2020
aacc763
fix circle.yml separate command for runner-integration-tests
kuceb May 6, 2020
7777d5a
update runner/integration tests + snapshot after error improvements
kuceb May 7, 2020
f0e0cd6
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 7, 2020
8acbd6d
fix runner/integration snapshots for chrome/ff stacktrace differences
kuceb May 7, 2020
f82be9e
rerun ci
kuceb May 7, 2020
d3ed77d
fix passing --parallel to runner-integration tests
kuceb May 7, 2020
6d1451d
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 7, 2020
ec77ac3
perf: faster lookup for hooks without runnables
kuceb May 7, 2020
751e752
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 8, 2020
6790888
fix afterAll hook switch logic
kuceb May 8, 2020
e1bc067
Merge remote-tracking branch 'origin/2-fix-rerun-hooks-on-navigation'…
kuceb May 12, 2020
fcca3fd
Merge branch 'isolated-runner-fixes' into test-retries
kuceb May 15, 2020
71e2189
simplify mocha prototype patches
kuceb May 16, 2020
fbbf67f
fix decaf utils.coffee after merge
kuceb May 16, 2020
2f06046
backport to before/after fix
kuceb May 20, 2020
75bf3bf
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 20, 2020
d230c17
backport to before/after fix 2
kuceb May 20, 2020
fe79190
Merge remote-tracking branch 'origin/2-fix-rerun-hooks-on-navigation'…
kuceb May 12, 2020
2e3993c
cleanup from decaf, fix ui/package.json
kuceb May 20, 2020
52d7166
update helpers, simplify runner.spec
kuceb May 20, 2020
73ee906
fix lint-types errors, flaky spec
kuceb May 20, 2020
1f529df
Merge commit '73ee90675' into test-retries
kuceb May 21, 2020
f2977b7
fix noExit passed to e2e test inline options
kuceb May 22, 2020
836fc0a
Merge remote-tracking branch 'origin/develop' into 2-fix-rerun-hooks-…
kuceb May 22, 2020
70b9b09
Merge remote-tracking branch 'origin/2-fix-rerun-hooks-on-navigation'…
kuceb May 22, 2020
16be5c2
cleanup snapshot utility - refactor to use util file
kuceb May 22, 2020
bee8408
remove before/after changes
kuceb May 26, 2020
2a1fc2a
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 26, 2020
d82f8b4
make cy obj a class instance
kuceb May 26, 2020
90ba8ba
cleanup/unmerge before/after fixes PR...
kuceb May 26, 2020
6500edc
more cleanup
kuceb May 26, 2020
156d51b
add comment
kuceb May 28, 2020
5a8e064
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb May 28, 2020
e57b576
fix runner.spec
kuceb Jun 1, 2020
a77a0b6
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Jun 3, 2020
93943e5
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Jun 4, 2020
ece0481
cleanup snapshot utility more, cleanup reporter.spec
kuceb Jun 4, 2020
dd827ee
fix after merge
kuceb Jun 4, 2020
aaf657f
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Jun 8, 2020
230ffef
minor rename variable
kuceb Jun 8, 2020
afb2185
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Jun 8, 2020
3d3da8a
fix after merge: decaffed files
kuceb Jun 8, 2020
1378233
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Jun 8, 2020
edd75b0
fix specName in reporterHeader, spec_helper require
kuceb Jun 8, 2020
9143eef
replace reporter specPath usages with spec object from config
kuceb Jun 8, 2020
1348b35
cleanup, fix specs, fix types tests
kuceb Jun 8, 2020
87db3c8
Merge branch 'chore-refactor-specpath-reporter-use' into isolated-run…
kuceb Jun 9, 2020
1ab5d71
fix config spec paths in isolated runner, fix snapshot plugin button
kuceb Jun 9, 2020
9211e53
combine runner.spec.js and runner_spec.js
kuceb Jun 9, 2020
5a9a7a8
fix incorrect merge
kuceb Jun 9, 2020
fec95de
minor minor cleanup
kuceb Jun 9, 2020
0872413
rename driver/test/cypress to driver/test
kuceb Jun 9, 2020
f658ea6
use yarn workspace over lerna for individual package commands
kuceb Jun 9, 2020
042b9bb
Merge branch 'chore-use-yarn-workspaces-over-lerna' into chore-move-d…
kuceb Jun 9, 2020
18239dd
add error message to driver start
kuceb Jun 9, 2020
ffd7875
remove usage of wait-on
kuceb Jun 9, 2020
b696f6b
update <reference types/>, import string
kuceb Jun 10, 2020
72a3fce
Merge remote-tracking branch 'origin/develop' into chore-move-driver-…
kuceb Jun 10, 2020
3888716
fix driver/readme
kuceb Jun 10, 2020
ab57cdc
fix readmes after regex replace
kuceb Jun 10, 2020
ca20729
Merge remote-tracking branch 'origin/develop' into chore-use-yarn-wor…
kuceb Jun 10, 2020
3c2927b
Merge branch 'chore-use-yarn-workspaces-over-lerna' into chore-move-d…
kuceb Jun 10, 2020
6de684c
revert wait-on changes
kuceb Jun 10, 2020
fc56b8e
Merge branch 'chore-use-yarn-workspaces-over-lerna' into chore-move-d…
kuceb Jun 10, 2020
930b718
Revert "revert wait-on changes"
kuceb Jun 10, 2020
f2b8c4e
update yarn.lock
kuceb Jun 10, 2020
e6bcb4f
fix broken path in spec
kuceb Jun 10, 2020
55a16cb
fix broken paths in specs with @packages/driver
kuceb Jun 10, 2020
df9d0d4
move runner/test/cypress into runner/cypress
kuceb Jun 10, 2020
7d736cc
Merge branch 'chore-move-driver-tests-into-parent' into isolated-runn…
kuceb Jun 10, 2020
002d037
start server in pluginsFile in runner/cypress tests
kuceb Jun 10, 2020
1f78711
fix more broken spec paths
kuceb Jun 10, 2020
35619a7
Merge branch 'chore-move-driver-tests-into-parent' into isolated-runn…
kuceb Jun 10, 2020
6d5d32e
fix broken paths after runner/cypress folder move
kuceb Jun 10, 2020
cd7b49f
Merge remote-tracking branch 'origin/chore-use-yarn-workspaces-over-l…
kuceb Jun 10, 2020
8fc44d2
Merge remote-tracking branch 'origin/develop' into chore-move-driver-…
kuceb Jun 10, 2020
748b9a7
Merge branch 'chore-move-driver-tests-into-parent' into isolated-runn…
kuceb Jun 10, 2020
f1f9dde
move type definition loading for driver/cypress into dedicated file
kuceb Jun 10, 2020
b696fbb
move internal-types to "types" folder, fix driver/index.d.ts
kuceb Jun 10, 2020
c091b20
Merge branch 'develop' into isolated-runner-fixes
brian-mann Jun 11, 2020
0c7dffa
Merge branch 'develop' into chore-move-driver-tests-into-parent
brian-mann Jun 11, 2020
8882130
fix type-check in packages/runner. not exactly sure why
kuceb Jun 11, 2020
096bbf9
fix runner type-check by excluding test folder in tsconfig
kuceb Jun 11, 2020
e3257bf
bump timeout on e2e/8_error_ui_spec
kuceb Jun 11, 2020
f5bc2ed
update snapshot utility, rename tests in runner/runner.spec, fix READ…
kuceb Jun 11, 2020
0cb50b3
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Jun 11, 2020
c4bc864
delete old spec
kuceb Jun 11, 2020
5597ec4
Merge branch 'chore-move-driver-tests-into-parent' into isolated-runn…
kuceb Jun 11, 2020
fe5ece1
Merge remote-tracking branch 'origin/develop' into chore-move-driver-…
kuceb Jun 11, 2020
3f4d7df
Merge branch 'chore-move-driver-tests-into-parent' into isolated-runn…
kuceb Jun 11, 2020
c19f6c2
fix snapshot naming, remove redundant test in reporter_spec
kuceb Jun 12, 2020
2ec185f
fix file renames after merge
kuceb Jun 12, 2020
6b655e9
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Jun 12, 2020
40682e5
rename runner/ snapshot
kuceb Jun 12, 2020
a715439
update server/unit/reporter_spec snapshot
kuceb Jun 12, 2020
9a74188
update runner/runner_spec snapshot
kuceb Jun 12, 2020
489be5d
rename runner snapshot file
kuceb Jun 15, 2020
4ea9cbe
address feedback: move server reporter snapshot specs out
kuceb Jun 16, 2020
1a0ac78
address feedback: add comment about exposing globals
kuceb Jun 16, 2020
5726ec9
fix test-retries after merging isolated-runner
kuceb Jun 16, 2020
af6ddd4
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Jun 16, 2020
f2ad5cb
fix runner/test helper, update snapshot
kuceb Jun 16, 2020
121fafb
Merge remote-tracking branch 'origin/develop' into isolated-runner-fixes
kuceb Jun 16, 2020
2952a78
Merge branch 'isolated-runner-fixes' into test-retries
kuceb Jun 16, 2020
09ca4a0
address feedback: split out runner/retries spec, move reporter/ui tes…
kuceb Jun 17, 2020
91fbf66
fix scrolling, attempt opening, update snapshots
kuceb Jun 19, 2020
952189b
fix e2e support file
kuceb Jun 22, 2020
e7a4ab7
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jun 22, 2020
d198a69
fix 5_spec_isolation
kuceb Jun 22, 2020
2a8d06d
fix mislabeling attempt screenshots
kuceb Jun 22, 2020
367132a
only add test results prevAttempts if exists
kuceb Jun 22, 2020
8ac878a
fix reporter/unit tests, server/unit tests
kuceb Jun 23, 2020
f97a85c
remove dead code, fix test isOpen
kuceb Jun 24, 2020
bc6b9f4
update snapshots for retries.mochaEvents, fix snapshot error in state…
kuceb Jun 24, 2020
691eafc
new moduleAPI schema using attempts array, fix wrapping errors from h…
kuceb Jun 25, 2020
04bd5ef
add displayError, null out fields in moduleAPI schema
kuceb Jun 25, 2020
a51669d
change default retries to {runMode:2, openMode:0}
kuceb Jun 25, 2020
48ebd4f
fix reporter type-check
kuceb Jun 25, 2020
1dd04da
upgrade json-schemas, update snapshots
kuceb Jun 25, 2020
8723bb7
reformat error.stack to be only stacktrace, update snapshots
kuceb Jun 26, 2020
ec379d3
fix stacktrace replacing in 5_spec_isolation
kuceb Jun 26, 2020
11dc267
fix navigation error causing infinite reloading, bump timeout on e2e/…
kuceb Jun 26, 2020
278d92a
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jun 26, 2020
4b39bd7
fix server/unit tests for new schema
kuceb Jun 26, 2020
0dc2a2a
fix reporter/unit tests
kuceb Jun 26, 2020
de651fa
fix reporting duplicate screenshots using cy.screenshot during test r…
kuceb Jun 27, 2020
755080d
update snapshot for 6_uncaught_support_file_spec
kuceb Jun 27, 2020
37ca121
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jul 6, 2020
b6d63ba
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Jul 6, 2020
b990060
bump x-route-version: 3
kuceb Jul 6, 2020
e95cf9a
fix test.tsx collapsible content, css, fix e2e/8_error_ui, e2e projec…
kuceb Jul 7, 2020
126bc9e
fix css, fix padding in runnable-instruments, fix runner/integration …
kuceb Jul 9, 2020
14be2ec
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jul 9, 2020
7cdcaf3
fixup after merge
kuceb Jul 9, 2020
73c7b08
fix reporter/runner to work with split hooks
kuceb Jul 10, 2020
846449d
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jul 10, 2020
d66b04d
update api tests, runner/cypress tests, reporter
kuceb Jul 13, 2020
0b515b1
Merge remote-tracking branch 'origin/develop' into test-retries
kuceb Jul 13, 2020
fbb02a2
fix 5_spec_isolation snapshots, fix runner/cypress errors.spec, fix n…
kuceb Jul 13, 2020
b5bf523
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Jul 13, 2020
91afb75
fix e2e/non_root spec, fix type_check, fix reporter/unit tests
kuceb Jul 14, 2020
0d4650b
setup percy snapshots in runner/cypress, fix driver/runner test:after…
kuceb Jul 15, 2020
3152e3e
add customPercySnapshot
kuceb Jul 15, 2020
3ecb65e
fix circle.yml
kuceb Jul 15, 2020
7c1ee28
fix circle.yml 2
kuceb Jul 15, 2020
e3ec883
fix circle.yml 3
kuceb Jul 15, 2020
b248010
add warning for incompatible retries plugin
kuceb Jul 16, 2020
f692bc5
add more percy snapshots
kuceb Jul 17, 2020
fabced7
fix firefox screenshot resolution in e2e test
kuceb Jul 17, 2020
8b3ba9c
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Jul 17, 2020
c43d39f
Fix testConfigOverrides not affecting viewport (#8006)
kuceb Jul 17, 2020
87eec3e
finish adding percy snapshots to runner/cypress retries spec, update …
kuceb Jul 17, 2020
4a74890
Merge branch 'v5.0-release' into test-retries
brian-mann Jul 20, 2020
e5d1626
remove .only
brian-mann Jul 20, 2020
1bc7c3c
Merge branch 'v5.0-release' into test-retries
brian-mann Jul 20, 2020
342bb14
fixing missing repo argument
brian-mann Jul 20, 2020
a947761
fix testConfigOverrides usage with retries, fix test
kuceb Jul 20, 2020
f570157
fix issues from previous merge
kuceb Jul 20, 2020
87aae16
add script that can query CircleCI workflow status
bahmutov Jul 21, 2020
c59ae4e
add circleci job to poll
bahmutov Jul 21, 2020
6d9d376
add retries
bahmutov Jul 21, 2020
638345d
try yarn lock
bahmutov Jul 21, 2020
f17560c
retry, percy finalize
bahmutov Jul 21, 2020
b21494a
check for current running job
bahmutov Jul 21, 2020
a415fd1
do not swallow request error
bahmutov Jul 21, 2020
85cac6f
better print
bahmutov Jul 21, 2020
c57775c
use job name from circle environment
bahmutov Jul 21, 2020
97b3190
use debug instead
bahmutov Jul 21, 2020
3d53bd8
renamed circle polling script
brian-mann Jul 21, 2020
305a7bc
refactor circle to conditionally run percy-finalize when env var is a…
brian-mann Jul 21, 2020
2f26f8d
use multi-line strings and quote --job-names
brian-mann Jul 21, 2020
8b7ee59
add comment
bahmutov Jul 21, 2020
b708502
Merge branch 'test-retries' of github.com:cypress-io/cypress into tes…
bahmutov Jul 21, 2020
bb02f65
only poll until the jobs to wait for are blocked or running
bahmutov Jul 21, 2020
4c42a44
fix running hooks at correct depth after attempt fails from hook and …
kuceb Jul 22, 2020
4ac06f4
fix reporter/unit tests, remove unused toggleOpen code
kuceb Jul 22, 2020
8510ea6
move custom percy command into @packages/ui-components and apply them…
brian-mann Jul 22, 2020
19d4a8b
halt percy finalize job if env variable is not set
bahmutov Jul 22, 2020
748d6f4
if only I could code
bahmutov Jul 22, 2020
88c535a
update runner/cypress mochaEvent snapshots, fix e2e firefox resolution
kuceb Jul 22, 2020
f80325f
fix css for attempt border-left, fix attempt-tag open/close icon, add…
kuceb Jul 22, 2020
8ec9c11
try percy set viewport width
kuceb Jul 22, 2020
e8f5487
set default retries back to {runMode:0, openMode:0}
kuceb Jul 23, 2020
0ca34aa
formatting: add backticks to warning message
kuceb Jul 23, 2020
f5bb489
write explicit test for screenshot overwriting behavior, fix snapshot…
kuceb Jul 23, 2020
518e730
fix e2e.it.only`
kuceb Jul 23, 2020
00e7698
cleanup whitespace
kuceb Jul 23, 2020
44e3e90
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Jul 23, 2020
7d7f723
update snapshots
kuceb Jul 24, 2020
dd6ea92
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Jul 31, 2020
c5f2b04
fix cypress module API types for new result schema
kuceb Aug 4, 2020
ad4dc55
build and upload binary for test-retries branch too (linux)
bahmutov Aug 4, 2020
3be9ff8
add pre-release PR comment
kuceb Aug 4, 2020
dff06aa
fix pre-release commit comment
kuceb Aug 4, 2020
c150111
rename runner/cypress test
kuceb Aug 7, 2020
2fb38df
update retries.ui.spec test titles
kuceb Aug 10, 2020
cd1119b
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Aug 10, 2020
df26592
fix after merge: use most recent attempt for before/after hooks
kuceb Aug 10, 2020
608fd72
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Aug 10, 2020
6988ef0
add suite title to hook error in runner/cypress tests
kuceb Aug 10, 2020
b0e7db2
Merge remote-tracking branch 'origin/v5.0-release' into test-retries
kuceb Aug 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"plugin:@cypress/dev/general"
],
"rules": {
"prefer-spread": "off"
"prefer-spread": "off",
"prefer-rest-params": "off"
},
"settings": {
"react": {
Expand Down
80 changes: 66 additions & 14 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,22 @@ commands:
browser:
description: browser shortname to target
type: string
percy:
description: enable percy
type: boolean
default: false
steps:
- attach_workspace:
at: ~/
- run:
command: |
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --') || true

CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=$PACKAGES_RECORD_KEY \
yarn workspace @packages/runner cypress:run --record --parallel --group runner-integration-<<parameters.browser>> --browser <<parameters.browser>>
PERCY_PARALLEL_NONCE=$CIRCLE_WORKFLOW_ID \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/runner cypress:run --record --parallel --group runner-integration-<<parameters.browser>> --browser <<parameters.browser>>
- store_test_results:
path: /tmp/cypress
- store_artifacts:
Expand Down Expand Up @@ -211,6 +219,7 @@ commands:
command: |
git clone --depth 1 --no-single-branch https://github.com/cypress-io/<<parameters.repo>>.git /tmp/<<parameters.repo>>
cd /tmp/<<parameters.repo>> && (git checkout $NEXT_DEV_VERSION || true)

test-binary-against-repo:
description: |
Takes the built binary and NPM package, clones given example repo
Expand Down Expand Up @@ -337,6 +346,17 @@ commands:
path: /tmp/<<parameters.repo>>/cypress/videos
- store-npm-logs

wait-on-circle-jobs:
description: Polls certain Circle CI jobs until they finish
parameters:
job-names:
description: comma separated list of circle ci job names to wait for
type: string
steps:
- run:
name: "Waiting on Circle CI jobs: <<parameters.job-names>>"
command: node ./scripts/wait-on-circle-jobs.js --job-names="<<parameters.job-names>>"

jobs:
## code checkout and yarn installs
build:
Expand Down Expand Up @@ -400,6 +420,37 @@ jobs:
command: node cli/bin/cypress info --dev
- store-npm-logs

# a special job that keeps polling Circle and when all
# individual jobs are finished, it closes the Percy build
percy-finalize:
<<: *defaults
executor: cy-doc
parameters:
required_env_var:
type: env_var_name
steps:
- attach_workspace:
at: ~/
- run:
# if this is an external pull request, the environment variables
# are NOT set for security reasons, thus no need to poll -
# and no need to finalize Percy, since there will be no visual tests
name: Check if <<parameters.required_env_var>> is set
command: |
if [[ -v <<parameters.required_env_var>> ]]; then
echo "Internal PR, good to go"
else
echo "This is an external PR, cannot access other services"
circleci-agent step halt
fi
- wait-on-circle-jobs:
job-names: >
desktop-gui-integration-tests-2x,
desktop-gui-component-tests,
cli-visual-tests,
runner-integration-tests-chrome,
- run: npx percy finalize --all

cli-visual-tests:
<<: *defaults
parallelism: 1
Expand Down Expand Up @@ -701,6 +752,7 @@ jobs:
steps:
- run-runner-integration-tests:
browser: chrome
percy: true

runner-integration-tests-firefox:
<<: *defaults
Expand Down Expand Up @@ -879,13 +931,6 @@ jobs:
command: node index.js
working_directory: packages/launcher

percy-finalize:
<<: *defaults
steps:
- run:
name: "finalizes percy builds"
command: npx percy finalize --all

build-binary:
<<: *defaults
shell: /bin/bash --login
Expand Down Expand Up @@ -1369,6 +1414,11 @@ jobs:
command: npm run test:ci
pull_request_id: 515
folder: examples/fundamentals__typescript
- test-binary-against-repo:
repo: cypress-example-recipes
command: npm test
pull_request_id: 513
folder: examples/fundamentals__module-api-wrap

"test-binary-against-kitchensink":
<<: *defaults
Expand Down Expand Up @@ -1493,6 +1543,11 @@ linux-workflow: &linux-workflow
name: Linux lint
requires:
- build
- percy-finalize:
context: test-runner:poll-circle-workflow
required_env_var: PERCY_TOKEN # skips job if not defined (external PR)
requires:
- build
- lint-types:
requires:
- build
Expand Down Expand Up @@ -1624,12 +1679,6 @@ linux-workflow: &linux-workflow
requires:
- build

- percy-finalize:
requires:
- desktop-gui-integration-tests-2x
- desktop-gui-component-tests
- cli-visual-tests

# various testing scenarios, like building full binary
# and testing it on a real project
- test-against-staging:
Expand Down Expand Up @@ -1666,6 +1715,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- test-retries
requires:
- build-npm-package
- build-binary:
Expand All @@ -1677,6 +1727,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- test-retries
requires:
- build-binary
- test-npm-module-on-minimum-node-version:
Expand Down Expand Up @@ -1733,6 +1784,7 @@ linux-workflow: &linux-workflow
branches:
only:
- develop
- test-retries
requires:
- upload-npm-package
- upload-binary
Expand Down
12 changes: 12 additions & 0 deletions cli/schema/cypress.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,18 @@
"type": "boolean",
"default": false,
"description": "Polyfills `window.fetch` to enable Network spying and stubbing"
},
"retries": {
"type": [
"object",
"number",
"null"
],
"default": {
"runMode": 0,
"openMode": 0
},
"description": "The number of times to retry a failing. Can be configured to apply only in runMode or openMode"
}
}
}
22 changes: 15 additions & 7 deletions cli/types/cypress-npm-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
// but for now describe it as an ambient module

declare namespace CypressCommandLine {
interface TestError {
name: string
message: string
stack: string
}
/**
* All options that one can pass to "cypress.run"
* @see https://on.cypress.io/module-api#cypress-run
Expand Down Expand Up @@ -166,14 +171,16 @@ declare namespace CypressCommandLine {
title: string[]
state: string
body: string
/**
* Error stack string if there is an error
*/
stack: string | null
/**
* Error message if there is an error
/**
* Error string as it's presented in console if the test fails
*/
error: string | null
displayError: string | null
attempts: AttemptResult[]
}

interface AttemptResult {
state: string
error: TestError | null
timings: any
failedFromHookId: hookId | null
wallClockStartedAt: dateTimeISO
Expand All @@ -199,6 +206,7 @@ declare namespace CypressCommandLine {
name: string
testId: testId
takenAt: dateTimeISO
testAttemptIndex: number
/**
* Absolute path to the saved image
*/
Expand Down
12 changes: 12 additions & 0 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ declare namespace Cypress {
*/
getFirefoxGcInterval(): number | null | undefined

/**
* @returns the number of test retries currently enabled for the run
*/
getTestRetries(): number | null

/**
* Checks if a variable is a valid instance of `cy` or a `cy` chainable.
*
Expand Down Expand Up @@ -2563,6 +2568,13 @@ declare namespace Cypress {
* the `includeShadowDom` option to some DOM commands.
*/
experimentalShadowDomSupport: boolean
/**
* Number of times to retry a failed test.
* If a number is set, tests will retry in both runMode and openMode.
* To enable test retries only in runMode, set e.g. `{ openMode: null, runMode: 2 }`
* @default null
*/
retries: Nullable<number | {runMode: Nullable<number>, openMode: Nullable<number>}>
}

interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'baseUrl' | 'defaultCommandTimeout' | 'taskTimeout' | 'animationDistanceThreshold' | 'waitForAnimations' | 'viewportHeight' | 'viewportWidth' | 'requestTimeout' | 'execTimeout' | 'env' | 'responseTimeout'>> {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
"fs-extra": "8.1.0",
"gift": "0.10.2",
"globby": "10.0.1",
"got": "11.5.1",
"gulp": "4.0.2",
"gulp-awspublish": "4.0.0",
"gulp-debug": "4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-gui/cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('@percy/cypress')
require('@packages/ui-components/cypress/support/customPercyCommand')
require('cypress-react-unit-test/dist/hooks')

const BluebirdPromise = require('bluebird')
Expand Down
16 changes: 13 additions & 3 deletions packages/driver/cypress/integration/commands/screenshot_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('src/cy/commands/screenshot', () => {
takenAt: new Date().toISOString(),
name: 'name',
blackout: ['.foo'],
testAttemptIndex: 0,
duration: 100,
}

Expand Down Expand Up @@ -49,7 +50,7 @@ describe('src/cy/commands/screenshot', () => {

Cypress.action('runner:runnable:after:run:async', test, runnable)
.then(() => {
expect(Cypress.action).not.to.be.calledWith('cy:test:set:state')
expect(Cypress.action).not.to.be.calledWith('test:set:state')
expect(Cypress.automation).not.to.be.called
})
.finally(() => {
Expand All @@ -68,7 +69,7 @@ describe('src/cy/commands/screenshot', () => {

Cypress.action('runner:runnable:after:run:async', test, runnable)
.then(() => {
expect(Cypress.action).not.to.be.calledWith('cy:test:set:state')
expect(Cypress.action).not.to.be.calledWith('test:set:state')
expect(Cypress.automation).not.to.be.called
})
})
Expand All @@ -89,7 +90,7 @@ describe('src/cy/commands/screenshot', () => {

Cypress.action('runner:runnable:after:run:async', test, runnable)
.then(() => {
expect(Cypress.action).not.to.be.calledWith('cy:test:set:state')
expect(Cypress.action).not.to.be.calledWith('test:set:state')
expect(Cypress.automation).not.to.be.called
})
})
Expand Down Expand Up @@ -137,6 +138,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: true,
disableTimersAndAnimations: true,
blackout: [],
testAttemptIndex: 0,
})

expect(Cypress.action).to.be.calledWith('cy:after:screenshot', {
Expand All @@ -147,6 +149,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: true,
disableTimersAndAnimations: true,
blackout: [],
testAttemptIndex: 0,
})
})
})
Expand Down Expand Up @@ -183,6 +186,7 @@ describe('src/cy/commands/screenshot', () => {
testFailure: true,
blackout: [],
scaled: true,
testAttemptIndex: 0,
})
})
})
Expand Down Expand Up @@ -225,6 +229,7 @@ describe('src/cy/commands/screenshot', () => {
simple: false,
scaled: true,
blackout: [],
testAttemptIndex: 0,
})
})
})
Expand Down Expand Up @@ -264,6 +269,7 @@ describe('src/cy/commands/screenshot', () => {
testFailure: true,
scaled: true,
blackout: [],
testAttemptIndex: 0,
})
})
})
Expand Down Expand Up @@ -406,6 +412,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: false,
disableTimersAndAnimations: true,
blackout: ['.foo'],
testAttemptIndex: 0,
})
})
})
Expand All @@ -425,6 +432,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: false,
disableTimersAndAnimations: true,
blackout: ['.foo'],
testAttemptIndex: 0,
})
})
})
Expand All @@ -446,6 +454,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: true,
disableTimersAndAnimations: true,
blackout: [],
testAttemptIndex: 0,
})
})
})
Expand All @@ -466,6 +475,7 @@ describe('src/cy/commands/screenshot', () => {
waitForCommandSynchronization: false,
disableTimersAndAnimations: true,
blackout: ['.foo'],
testAttemptIndex: 0,
})
})
})
Expand Down
Loading