Commit Graph

2474 Commits

Author SHA1 Message Date
Cacie Prins 3a739f3f4f perf: improve replay upload resiliency (#29174)
* tbd

* workable templated filestream uploader

* clean up async assertions

* upload stream uses activity monitor to detect start timeouts and stalls

* makes uploadStream retryable

* filesize detection, enoent errors, and testable retry delays

* extract fs logic to putProtocolArtifact, impl putProtocolArtifact

* aggregate errors for retryable upload streams

* fixes imports from moving api.ts, uses new upload mechanism in protocol.ts

* use spec_helper in StreamActivityMonitor_spec due to global sinon clock changes

* fix putProtocolArtifact specs when run as a part of the unit test suite

* fix return type of ProtocolManager.uploadCaptureArtifact

* convert from whatwg streams back to node streams

* extract HttpError

* ensure system test snapshots

* changelog

* more changelog

* fix unit tests

* fix api ref in integration test

* fix refs to api in snapshotting and after-pack

* small edits

* Update packages/server/lib/cloud/api/HttpError.ts

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Update packages/server/lib/cloud/upload/uploadStream.ts

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* camelcase -> snakeCase filenames

* improve docs for StreamActivityMonitor

* added documentation to: upload_stream, put_protocol_artifact_spec

* move stream activity monitor params to consts - no magic numbers. docs.

* Update packages/server/lib/cloud/api/http_error.ts

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Update packages/server/test/unit/cloud/api/put_protocol_artifact_spec.ts

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* fix check-ts

* fix imports in put_protocol_artifact_spec

* Update packages/server/test/unit/cloud/upload/stream_activity_monitor_spec.ts

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* api.ts -> index.ts

* fix comment style, remove confusingly inapplicable comment about whatwg streams

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2024-03-29 12:22:57 -04:00
Bill Glesias 9c27c37b06 fix: patch new tab creation for firefox 124 and up to fix issue where… (#29179)
* fix: patch new tab creation for firefox 124 and up to fix issue where cypress was not executing beyond the first spec in cypress run (specific to firefox).

* Update cli/CHANGELOG.md

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* opt for global window instead of no undef for window reference

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-03-21 13:37:23 -04:00
renovate[bot] d98fb368aa dependency: update dependency jose to v4.15.5 [security] (#29086)
* fix(deps): update dependency jose to v4.15.5 [security]

* bump jose

* Add changelog entry

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-03-13 17:07:08 -04:00
renovate[bot] adbefb6d8d dependency: update dependency jimp to v0.22.12 (#29055)
* fix(deps): update dependency jimp to v0.22.12

* changelog entry

* empty commit

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* chore: updating v8 snapshot cache

* remove reference to files that no longer exist

* Remove 'regeneratorRuntime' from allowList, this must have been removed from jimp

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: cypress-bot[bot] <+cypress-bot[bot]@users.noreply.github.com>
2024-03-08 17:39:28 -05:00
Cacie Prins e78531820a fix: screenshot() times out when the main Cypress tab is not focused (#29038)
* activate main cypress tab before taking a screenshot

* new tests to cover page activation behavior

* updates changelog

* whitespace

* fix check-ts

* reduce extension failure timeout to 500ms to account for origin bridge timeout

* only use tab activation workaround in chrome; default to Page.bringToFront in headless mode

* update unit tests

* swap order of tests in 5016 system test

* some debugging to try and hunt down firefox issue

* rm debug prev added - looks like sys test passed that time?

* rm debug emit from v2 extension
2024-03-08 11:09:41 -05:00
Cacie Prins 006faaa3ae chore: additional context on protocol upload network errors (#28986)
* chore: add additional context to messaging when network errors occur in protocol uploads

* reduce total attempts for uploading capture artifacts from 8 to 3
2024-03-06 12:49:16 -05:00
Matt Schile a29eae9260 perf: fix performance issue for service workers that don't handle requests (#28900) 2024-03-05 11:24:59 -07:00
renovate[bot] cdd7a7e10c dependency: update dependency signal-exit to v3.0.7 (#28979)
* fix(deps): update dependency signal-exit to v3.0.7

* Remove signal-exit - this is not used

* empty commit

* fix(deps): update dependency signal-exit to v3.0.7

* Update changelog

* Update cli/CHANGELOG.md

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2024-03-01 13:02:27 -05:00
Teo Anastasiadis 3e5fabce2c fix: Boolean and null literals should be considered valid request bodies (#28835)
* fix(types): RequestBody type should be able to accept booleans and null values, which are all valid JSON literals

* refactor: boolean literals are valid JSON objects. Null values should also be considered valid when explicitly passed to the request function.

* refactor: body is explicitly defined when passed as positional argument or when supplied through the options object

* test: JSON literals should be parsed as valid JSON and set json=true

* docs: issue reference

* fix: boolean and null literal should be send to request promise as strings

* docs: fixes #28789 -- added issue reference

* test: tests proper conversion of JSON literals to strings.

* docs: added isssue reference

* docs: fixes #28789 -- changelog entry

* refactor: change isValidJsonObj to isValidBody

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* refactor: change isValidJsonObj to isValidBody

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* refactor: use lodash utils

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Update cli/CHANGELOG.md

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* docs: moved entry to 13.6.5

* docs: fixed changelog entry

* Update CHANGELOG.md

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-02-23 16:11:18 -05:00
Jennifer Shehane 92d258274d chore: Delete gitignore for server (#28977)
* chore: Delete gitignore for server

* empty commit
2024-02-20 19:54:46 -05:00
Joshua D'Souza 2f86203cee misc: Replacing LayerCI references with webapp.io (finishing previous PR) (#28874)
* Replacing LayerCI references with webapp.io

* Update CI params exposed from webapp.io and add EXPOSE_WEBSITE_HOST

* Adding misc to changelog references changes from LayerCI to webappio

* Removing EXPOSE_WEBSITE_HOST

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-02-19 13:25:56 -05:00
renovate[bot] 6da53d4dca dependency: update dependency duplexify to v4.1.2 (#28941)
* fix(deps): update dependency duplexify to v4.1.2

* changelog entry

* Fix incorrect link in changelog

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-02-19 11:27:54 -05:00
renovate[bot] fcf73c7c6b dependency: update dependency is-ci to ^3.0.1 (#28933)
* fix(deps): update dependency is-ci to ^3.0.1

* fix: add changelog entry

* whoops, wrong changelog entry

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2024-02-14 13:10:25 -05:00
Ryan Manuel 9088dc232d fix: issue with service workers in test replay when they're initiated from a support file (#28748)
* fix: issue with service workers in test replay when they're initiated from a support file

* add changelog

* Update cli/CHANGELOG.md

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* PR comment

* get prerelease

* PR comments

* Update .circleci/workflows.yml

* Update .circleci/workflows.yml

Co-authored-by: Matt Schile <mschile@cypress.io>

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Matt Schile <mschile@cypress.io>
2024-01-23 12:22:02 -06:00
Matt Schile c672581a71 perf: fix proxy correlation timeout issues (#28751) 2024-01-22 15:35:49 -07:00
Bill Glesias 81fce0e253 fix: force moduleResolution: 'node' when ts-node is registered in the… (#28709)
* fix: force moduleResolution: 'node' when ts-node is registered in the cypress process to make sure value is compatible with commonjs (which is already forced). [run ci]

* Update cli/CHANGELOG.md
2024-01-16 12:09:12 -05:00
Emily Rohrbough 7880c488b8 dependency: update better-sqlite3 to 9.2.2 (#28700)
* dependency: update better-sqlite3 to 9.2.2

* Apply suggestions from code review

Co-authored-by: Matt Schile <mschile@cypress.io>

---------

Co-authored-by: Matt Schile <mschile@cypress.io>
2024-01-12 13:44:23 -06:00
Sam Tsai 46c2080ffd fix: Ensure original headers are included with extra target requests (#28671)
* fix: extra target request headers are overwritten

Include original headers with the special "X-Cypress-Is-From-Extra-Target" that is added so fetch requests can include custom headers.

* Add details to changelog

* refactor

---------

Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2024-01-11 14:08:24 -05:00
Emily Rohrbough 4b1df35741 fix: prevent timing out on short/skipped videos (#28643) 2024-01-11 09:56:31 -06:00
Ryan Manuel 6ee654426d chore: fix runtime error when service worker container is unavailable (#28678)
* chore: fix runtime error when service worker container is unavailable

* fix flake
2024-01-10 14:36:33 -06:00
Chris Breiding ec89901b9d fix: prevent redirect loop when chrome https upgrade is detected (#28650) 2024-01-09 15:25:57 -05:00
Emily Rohrbough 9528a67109 chore: updated to send protocol error stack traces (#28667) 2024-01-09 11:47:37 -06:00
Ryan Manuel c6f5e9a5c9 fix: ensure that we capture service worker requests (#28517)
* fix: ensure that we capture service worker requests

* add changelog

* fix changelog

* fix tests

* PR comments

* PR comments

* PR comment

* PR comment

* update changelog

* Update cli/CHANGELOG.md

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* enable builds on all archs

* fix permission issue

* PR comments

* Update smoke.js

* Update cli/CHANGELOG.md

* attempt to fix smoke tests

* bump ci cache

* Update smoke.js

* Update smoke.js

* Update example.json

* fix multiple specs

* fix tests

* Update CHANGELOG.md

---------

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
2024-01-06 15:23:30 -06:00
Matt Schile 7a9e3a4697 perf: don't reset preRequests when test isolation is off (#28642) 2024-01-05 14:52:47 -07:00
Emily Rohrbough b5bd3daeae chore: implement record telemetry for internal tests (#28425) 2024-01-03 14:09:29 -06:00
Jennifer Shehane 372515829e dependency: Bump ts-node to 10.9.2 (#28528) 2023-12-14 13:28:18 -05:00
Matt Schile c9062f145e fix: handle malformed URIs in prerequests (#28522) 2023-12-14 09:12:13 -07:00
Muaz Othman 522835d385 chore: better validation messages for experimental retries (#28214) 2023-12-05 09:31:43 -06:00
Chris Breiding 257861bd6e fix: Fix issue with using privileged commands when baseUrl includes basic auth credentials (#28428) 2023-11-29 22:40:02 -05:00
Matt Schile 57bb0b68ee fix: decode urls in prerequest (#28427) 2023-11-29 15:09:12 -07:00
Cacie Prins 7ba92b91e5 misc: persist upload timings to cy cloud (#28418)
* feat: report artifact upload durations to cy cloud for monitoring

* round upload durations to nearest ms

* update changelog

* revert changelog, fix typo in comment

* no longer round uploadDuration - api now accepts floats

* updates changelog

* update api spec for refactored signature on api.updateInstanceArtifacts

* Update CHANGELOG.md

* Update system-tests/test/record_spec.js

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>

* rm defunct comment

* rm non-null accessors, this spec is not ts

---------

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
2023-11-29 15:33:35 -05:00
Chris Breiding a423195b12 chore: Don't hoist devtools-protocol (#28372) 2023-11-22 08:19:00 -05:00
Matt Schile a22fd5cb82 dependency: updated chrome-remote-interface to 0.33.0 (#27998)
* dependency: updated chrome-remote-interface to 0.33.0

* updating changelog

* updating tests

* updating snapshot

* enable debug logs

* run ci without app integration tests

* .

* is this our problem? seems to be

* .

* run app tests

* .

* remove debug logs in ci

* clean up & re-enable all jobs

* .

* keep existing checked in error for now

* update changelog

---------

Co-authored-by: Emily Rohrbough <emilyrohrbough@yahoo.com>
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2023-11-20 16:08:52 -05:00
Cacie Prins e3ba69781d feat: display an activity indicator in the CLI output when uploading artifacts to cypress cloud (#28277)
* logic for activity indicator

* update snapshot & masking to handle upload duration, remove defunct mask for upload order

* update changelog

* check for existence of upload activity indicator before attempting to stop it

* updates changelog

* Update cli/CHANGELOG.md

* upload activity display improvements; configurable intervals and delays

* system test snapshots for video compression

* default delay and interval based on undefined rather than falsy

* reduce interval so upload indicator is captured in certain system tests

* Update CHANGELOG.md

* Update CHANGELOG.md

* remove initial delay for upload activity

* correctly evaluate if an upload activity interval env is set or not

* re-inserts spacing before upload activity indicator

* snapshots

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
2023-11-20 11:50:53 -05:00
Chris Breiding 424d408e26 misc: Close extra tabs/windows between tests (#28204) 2023-11-16 11:39:06 -05:00
Cacie Prins d54a1e9a57 feat: display artifact upload durations in the console (#28226)
* feat: display how long artifacts take to upload

* adds changelog entry

* add PR link to changelog

* bump circle cache

* previous masking was too greedy, made upload duration masking more limited in scope

* update snapshots for video compression system tests

* links changelog for upload durations to open issue

* reorder upload result manifest - show duration after filesize instead of after count

* update stdout normalization regex to be less applicable across system tests

* maybe better regex for masking

* another snapshot attempt

* chore: add after:browser:launch node event (#28180)

* test: update mochaEvent snapshots to be auto-generated (#28224)

* feat: add support for angular 17 (#28152)

* feat(webpack-dev-server): add support for angular 17

* update changelog

* fix broken spec pattern

* update to rc 2 for cli

* remove = from dependency minVersion lists

* update angular 17 rc version and update dep test

* add projectDirFolder to fixtures for angular-17

* resolve broken system tests

* update ct project dir angular version

* fix: runIfWaitingForDebugger when targets are reloaded after crashing (#28254)

* Update cli/CHANGELOG.md

Co-authored-by: Matt Schile <mschile@cypress.io>

* update snapshots

* Update CHANGELOG.md

---------

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Matt Schile <mschile@cypress.io>
Co-authored-by: Jordan <jordan@jpdesigning.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2023-11-16 10:01:54 -05:00
Ryan Manuel 16d6430827 fix: performance regression due to enabling ScopeMemoryCachePerContext (#28327) 2023-11-14 11:10:34 -06:00
Jennifer Shehane 8274f5ddb2 fix: Add Chromium flag to disable-component-extensions-with-background-pages (#28294) 2023-11-13 11:36:23 -05:00
Ryan Manuel d70ffea0bf fix: runIfWaitingForDebugger when targets are reloaded after crashing (#28254) 2023-11-07 07:37:12 -06:00
Chris Breiding 934f2157b3 chore: add after:browser:launch node event (#28180) 2023-11-06 17:32:39 -05:00
Emily Rohrbough eab1730dbb fix: handle download from element missing download attribute (#28222) 2023-11-06 14:06:59 -06:00
Jennifer Shehane db8609e54f fix: Pass flag to chrome to disable translation prompt when running tests (#28227) 2023-11-06 11:56:11 -06:00
Ryan Manuel 5dbebe6e5e fix: ensure that chromium based browsers do not send out a lot of font requests when global styles change (#28217) 2023-11-03 14:39:56 -05:00
Ryan Manuel 8c4a1067cb fix: issue with 'other' targets not fully loading (#28229) 2023-11-03 11:28:49 -05:00
Chris Breiding a0cfed5044 fix: "bypass" proxying network requests from extra browser tabs/windows (#28188)
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Matt Schile <mschile@cypress.io>
2023-11-02 13:55:13 -04:00
Chris Breiding 6aafb528dd chore: extract Target.attachedToTarget and Target.targetDestroyed handlers into own methods (#28179) 2023-10-31 10:48:45 -04:00
Bill Glesias 201e9f366e feat: experimental retries (#27930)
* chore: set up feature/test-burn-in feature branch

* feat: add burnIn Configuration option (currently a no-op) (#27377)

* feat: add the burnIn Configuration to the config package. Option
currently is a no-op

* chore: make burn in experimental

* chore: set experimentalBurnIn to false by default

* feat: add new experimental retries configuration (#27412)

* feat: implement the experimental retries configuration options to pair
with test burn in

* [run ci]

* fix cache invalidation [run ci]

* fix snapshot added in v13 for module api to include test burn in experimentalflag

* chore: fix merge conflict

* chore: add burnInTestAction capability (#27768)

* add burnInTestAction capability

* feat: add burn in capability for cloud

* chore: fix snapshot for record_spec

* feat: implement experimental retries (#27826)

* chore: format the retries/runner snapshot files to make diff easier

* feat: implement experimentalRetries strategies 'detect-flake-and-pass-on-threshold' and 'detect-flake-but-always-fail'. This should not be a breaking change, though it does modify mocha and the test object even when the experiment is not configured. This is to exercise the system and make sure things still work as expected even when we go GA. Test updates will follow in following commits.

* chore: update snapshots from system tests and cy-in-cy tests that now have the cypress test metadata property _cypressTestStatusInfo. tests have been added in the fail-with-[before|after]each specs to visually see the suite being skipped when developing.

* chore: add cy-in-cy tests to verify reporter behavior for pass/fail tests, as well as new mocha snapshots to verify attempts. New tests were needed for this as the 'retries' option in testConfigOverrides currently is and will be invalid for experiment and will function as an override. tests run in the cy-in-cy tests are using globally configured experimentalRetries for the given tested project, which showcases the different behavior between attempts/retries and pass/fail status.

* chore: add unit test like driver test to verify the test object in mocha is decorated/handled properly in calculateTestStatus

* chore: add sanity system tests to verify console reporter output for experimental retries logic. Currently there is a bug in the reporter where the logged status doesnt wait for the aftereach to complete, which impacts the total exitCode and printed status.

* fix: aftereach console output. make sure to fail the test in the appropriate spot in runner.ts and not prematurely, which in turn updates the snapshots for cy-in-cy as the fail event comes later."

* chore: address comments from code review

* fix: make sure hook failures print outer status + attempts when the error is the hook itself.

* chore: improve types within calculateTestStatus inside mocha.ts

* Revert "feat: add burnIn Configuration option (currently a no-op) (#27377)"

This reverts commit c428443079.

* Revert "chore: add burnInTestAction capability (#27768)"

This reverts commit ae3df1a505.

* chore: run snapshot and binary jobs against experimental retries feature branch

* chore: add changelog entry (wip)

* Revert "fix snapshot added in v13 for module api to include test burn in experimentalflag"

This reverts commit bb5046c91e.

* Fix system tests

* Clear CircleCI cache

* Normalize retries config for test execution

* Fixed some unit tests

* update snapshots for newer test metadata

* Fix cy-in-cy snapshots

* update snapshots

* bump cache version

* chore: ensure legacy retry overrides work; reject exp. retries overrides (#28045)

* update changelog

* flip if statement in experimental retries option validation

* refactor invalid experimental retry override for more useful error msg

* revert testConfigOverrides snapshot

* update snapshots for test override sys test

* Update packages/config/src/validation.ts

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>

* succinct changelog entry; links to docs for details

* testConfigOverride system test snapshots

* Update .github/workflows/update_v8_snapshot_cache.yml

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update cli/CHANGELOG.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* Update packages/driver/src/cypress.ts

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* updating cache-version

* improve typescript usage when appending experimental retry options to experiments in Experimenets.vue

* Revert "improve typescript usage when appending experimental retry options to experiments in Experimenets.vue"

This reverts commit b459aba882.

* refactor test config override validation for experimental retry subkeys

* account for error throw differences in browsers in system tests

* bump circle cache

* bump circle cache again

---------

Co-authored-by: astone123 <adams@cypress.io>
Co-authored-by: mabela416 <mabel@cypress.io>
Co-authored-by: Muaz Othman <muaz@cypress.io>
Co-authored-by: Muaz Othman <muazweb@gmail.com>
Co-authored-by: Cacie Prins <cacie@cypress.io>
Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Matthew Schile <mschile@cypress.io>
2023-10-26 14:06:14 -04:00
Ryan Manuel 80cc83d0aa chore: fix test flake with shared workers and correlating on failures (#28132)
Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
2023-10-26 09:17:33 -05:00
Ryan Manuel 15f730007f fix: issue with service worker attachments (#28147)
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
2023-10-26 09:16:20 -05:00
Ryan Manuel dbd213926c fix: issue with proxy correlations and web/shared workers (#28105) 2023-10-23 22:26:21 -05:00