diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 16ed9e8e5d0a..bc3331994b8d 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -4-17-2025-v1 +4-22-2025 diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 6466738c3ac9..02061c5aea95 100644 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -38,7 +38,7 @@ mainBuildFilters: &mainBuildFilters - /^release\/\d+\.\d+\.\d+$/ # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - 'update-v8-snapshot-cache-on-develop' - - 'ryanm/chore/full-snapshot-threaded' + - 'ryanm/fix/having-trouble-debugging-your-ci-failures-minimal' # usually we don't build Mac app - it takes a long time # but sometimes we want to really confirm we are doing the right thing @@ -49,7 +49,11 @@ macWorkflowFilters: &darwin-workflow-filters - equal: [ develop, << pipeline.git.branch >> ] # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - - equal: [ 'ryanm/chore/full-snapshot-threaded', << pipeline.git.branch >> ] + - equal: + [ + 'ryanm/fix/having-trouble-debugging-your-ci-failures-minimal', + << pipeline.git.branch >> + ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -60,7 +64,11 @@ linuxArm64WorkflowFilters: &linux-arm64-workflow-filters - equal: [ develop, << pipeline.git.branch >> ] # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - - equal: [ 'ryanm/chore/full-snapshot-threaded', << pipeline.git.branch >> ] + - equal: + [ + 'ryanm/fix/having-trouble-debugging-your-ci-failures-minimal', + << pipeline.git.branch >> + ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -83,7 +91,11 @@ windowsWorkflowFilters: &windows-workflow-filters - equal: [ develop, << pipeline.git.branch >> ] # use the following branch as well to ensure that v8 snapshot cache updates are fully tested - equal: [ 'update-v8-snapshot-cache-on-develop', << pipeline.git.branch >> ] - - equal: [ 'ryanm/chore/full-snapshot-threaded', << pipeline.git.branch >> ] + - equal: + [ + 'ryanm/fix/having-trouble-debugging-your-ci-failures-minimal', + << pipeline.git.branch >> + ] - matches: pattern: /^release\/\d+\.\d+\.\d+$/ value: << pipeline.git.branch >> @@ -157,7 +169,7 @@ commands: name: Set environment variable to determine whether or not to persist artifacts command: | echo "Setting SHOULD_PERSIST_ARTIFACTS variable" - echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/chore/full-snapshot-threaded" ]]; then + echo 'if ! [[ "$CIRCLE_BRANCH" != "develop" && "$CIRCLE_BRANCH" != "release/"* && "$CIRCLE_BRANCH" != "ryanm/fix/having-trouble-debugging-your-ci-failures-minimal" ]]; then export SHOULD_PERSIST_ARTIFACTS=true fi' >> "$BASH_ENV" # You must run `setup_should_persist_artifacts` command and be using bash before running this command diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index ecb5fc17d762..cdc6afb42c3f 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -6,6 +6,7 @@ _Released 4/22/2025 (PENDING)_ **Bugfixes:** - Fixed an issue where auto scroll in the Cypress Command Log was not scrolling correctly. Fixes [#31530](https://github.com/cypress-io/cypress/issues/31530). +- Fixed an issue where a message pointing users to the Cypress Cloud was not displaying on runs with failures in CI. Fixes [#31550](https://github.com/cypress-io/cypress/issues/31550). ## 14.3.1 diff --git a/packages/server/__snapshots__/cypress_spec.js b/packages/server/__snapshots__/cypress_spec.js index e37d89dfe53b..f5e9aa69421d 100644 --- a/packages/server/__snapshots__/cypress_spec.js +++ b/packages/server/__snapshots__/cypress_spec.js @@ -412,10 +412,10 @@ exports['CLOUD_RECOMMENDATION_MESSAGE'] = ` ---------------------------------------------------------------------------------------------------- - Having trouble debugging your CI failures? + Debug faster with full visibility. - Record your runs to Cypress Cloud to watch video recordings for each test, - debug failing and flaky tests, and integrate with your favorite tools. + Record to Cypress Cloud and get instant access to full test details and replays. + Inspect the DOM, network events, and console logs exactly as they ran in CI. >> https://on.cypress.io/cloud-get-started diff --git a/packages/server/lib/util/print-run.ts b/packages/server/lib/util/print-run.ts index bf135ee81e2f..de1ea9bd9a28 100644 --- a/packages/server/lib/util/print-run.ts +++ b/packages/server/lib/util/print-run.ts @@ -29,10 +29,10 @@ type Screenshot = { } export const cloudRecommendationMessage = ` - Having trouble debugging your CI failures? + Debug faster with full visibility. - Record your runs to Cypress Cloud to watch video recordings for each test, - debug failing and flaky tests, and integrate with your favorite tools. + Record to Cypress Cloud and get instant access to full test details and replays. + Inspect the DOM, network events, and console logs exactly as they ran in CI. ` function color (val: any, c: string) { diff --git a/system-tests/__snapshots__/ci_failure_spec.ts.js b/system-tests/__snapshots__/ci_failure_spec.ts.js new file mode 100644 index 000000000000..e8cd2f7bca6d --- /dev/null +++ b/system-tests/__snapshots__/ci_failure_spec.ts.js @@ -0,0 +1,78 @@ +exports['CI failure fails and displays the message that points users to the cloud 1'] = ` + +==================================================================================================== + + (Run Starting) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Cypress: 1.2.3 │ + │ Browser: FooBrowser 88 │ + │ Specs: 1 found (simple_failing.cy.js) │ + │ Searched: cypress/e2e/simple_failing.cy.js │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + + +──────────────────────────────────────────────────────────────────────────────────────────────────── + + Running: simple_failing.cy.js (1 of 1) + + + simple failing spec + 1) fails1 + 2) fails2 + + + 0 passing + 2 failing + + 1) simple failing spec + fails1: + AssertionError: Timed out retrying after 100ms: expected true to be false + [stack trace lines] + + 2) simple failing spec + fails2: + Error: fails2 + [stack trace lines] + + + + + (Results) + + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Tests: 2 │ + │ Passing: 0 │ + │ Failing: 2 │ + │ Pending: 0 │ + │ Skipped: 0 │ + │ Screenshots: 0 │ + │ Video: false │ + │ Duration: X seconds │ + │ Spec Ran: simple_failing.cy.js │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + + +==================================================================================================== + + (Run Finished) + + + Spec Tests Passing Failing Pending Skipped + ┌────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ ✖ simple_failing.cy.js XX:XX 2 - 2 - - │ + └────────────────────────────────────────────────────────────────────────────────────────────────┘ + ✖ 1 of 1 failed (100%) XX:XX 2 - 2 - - + +---------------------------------------------------------------------------------------------------- + + Debug faster with full visibility. + + Record to Cypress Cloud and get instant access to full test details and replays. + Inspect the DOM, network events, and console logs exactly as they ran in CI. + + >> https://on.cypress.io/cloud-get-started + +---------------------------------------------------------------------------------------------------- + +` diff --git a/system-tests/test/ci_failure_spec.ts b/system-tests/test/ci_failure_spec.ts new file mode 100644 index 000000000000..7fc5aa392102 --- /dev/null +++ b/system-tests/test/ci_failure_spec.ts @@ -0,0 +1,21 @@ +import systemTests from '../lib/system-tests' + +describe('CI failure', () => { + systemTests.setup() + + it('fails and displays the message that points users to the cloud', function () { + return systemTests.exec(this, { + browser: 'electron', + spec: 'simple_failing.cy.js', + processEnv: { + CI: '1', + CYPRESS_COMMERCIAL_RECOMMENDATIONS: '1', + }, + expectedExitCode: 2, + snapshot: true, + config: { + screenshotOnRunFailure: false, + }, + }) + }) +}) diff --git a/tooling/v8-snapshot/cache/darwin/snapshot-meta.json b/tooling/v8-snapshot/cache/darwin/snapshot-meta.json index 0eebc1044529..64a214480e66 100644 --- a/tooling/v8-snapshot/cache/darwin/snapshot-meta.json +++ b/tooling/v8-snapshot/cache/darwin/snapshot-meta.json @@ -1,5 +1,6 @@ { "norewrite": [ + "./ci-info/index.js", "./evil-dns/evil-dns.js", "./get-stream/buffer-stream.js", "./graceful-fs/polyfills.js", @@ -70,10 +71,8 @@ "./packages/server/lib/util/process_profiler.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/axios/lib/adapters/http.js", - "./packages/server/node_modules/ci-info/index.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", "./packages/server/node_modules/graceful-fs/polyfills.js", - "./packages/server/node_modules/is-ci/index.js", "./packages/server/node_modules/mocha/node_modules/debug/src/node.js", "./process-nextick-args/index.js", "./signal-exit/index.js", diff --git a/tooling/v8-snapshot/cache/linux/snapshot-meta.json b/tooling/v8-snapshot/cache/linux/snapshot-meta.json index 7c660197a762..3db440c9f7a7 100644 --- a/tooling/v8-snapshot/cache/linux/snapshot-meta.json +++ b/tooling/v8-snapshot/cache/linux/snapshot-meta.json @@ -1,5 +1,6 @@ { "norewrite": [ + "./ci-info/index.js", "./evil-dns/evil-dns.js", "./get-stream/buffer-stream.js", "./graceful-fs/polyfills.js", @@ -70,10 +71,8 @@ "./packages/server/lib/util/process_profiler.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/axios/lib/adapters/http.js", - "./packages/server/node_modules/ci-info/index.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", "./packages/server/node_modules/graceful-fs/polyfills.js", - "./packages/server/node_modules/is-ci/index.js", "./packages/server/node_modules/mocha/node_modules/debug/src/node.js", "./process-nextick-args/index.js", "./signal-exit/index.js", diff --git a/tooling/v8-snapshot/cache/win32/snapshot-meta.json b/tooling/v8-snapshot/cache/win32/snapshot-meta.json index 707d0b829bc2..ca1686de7a47 100644 --- a/tooling/v8-snapshot/cache/win32/snapshot-meta.json +++ b/tooling/v8-snapshot/cache/win32/snapshot-meta.json @@ -1,5 +1,6 @@ { "norewrite": [ + "./ci-info/index.js", "./evil-dns/evil-dns.js", "./get-stream/buffer-stream.js", "./graceful-fs/polyfills.js", @@ -70,10 +71,8 @@ "./packages/server/lib/util/process_profiler.ts", "./packages/server/lib/util/suppress_warnings.js", "./packages/server/node_modules/axios/lib/adapters/http.js", - "./packages/server/node_modules/ci-info/index.js", "./packages/server/node_modules/glob/node_modules/minimatch/minimatch.js", "./packages/server/node_modules/graceful-fs/polyfills.js", - "./packages/server/node_modules/is-ci/index.js", "./packages/server/node_modules/mocha/node_modules/debug/src/node.js", "./process-nextick-args/index.js", "./signal-exit/index.js", diff --git a/tooling/v8-snapshot/src/setup/force-no-rewrite.ts b/tooling/v8-snapshot/src/setup/force-no-rewrite.ts index 51cbcb639e53..32f14684a9c1 100644 --- a/tooling/v8-snapshot/src/setup/force-no-rewrite.ts +++ b/tooling/v8-snapshot/src/setup/force-no-rewrite.ts @@ -69,8 +69,7 @@ export default [ 'node_modules/prettier/parser-meriyah.js', 'node_modules/prettier/parser-typescript.js', 'node_modules/prettier/third-party.js', - 'packages/server/node_modules/is-ci/index.js', - 'packages/server/node_modules/ci-info/index.js', + 'ci-info/index.js', 'node_modules/@babel/traverse/lib/index.js', 'node_modules/@babel/types/lib/definitions/index.js', 'packages/server/node_modules/axios/lib/adapters/http.js',