From 55804945c117fd7af1531f056f8c5f2bd47133be Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 09:38:35 -0500 Subject: [PATCH 01/11] fix: ensure having trouble debugging your ci failures message displays --- .circleci/workflows.yml | 22 ++++++-- cli/CHANGELOG.md | 1 + cli/vue2/README.md | 7 +++ cli/vue2/package.json | 53 +++++++++++++++++++ packages/server/lib/util/print-run.ts | 6 +-- .../__snapshots__/ci_failure_spec_ts.js | 51 ++++++++++++++++++ system-tests/test/ci_failure_spec.ts | 21 ++++++++ tooling/v8-snapshot/package.json | 1 + .../v8-snapshot/src/setup/force-no-rewrite.ts | 3 +- 9 files changed, 155 insertions(+), 10 deletions(-) create mode 100644 cli/vue2/README.md create mode 100644 cli/vue2/package.json create mode 100644 system-tests/__snapshots__/ci_failure_spec_ts.js create mode 100644 system-tests/test/ci_failure_spec.ts 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/cli/vue2/README.md b/cli/vue2/README.md new file mode 100644 index 000000000000..0dcb604eebaf --- /dev/null +++ b/cli/vue2/README.md @@ -0,0 +1,7 @@ +# @cypress/vue2 + +Mount Vue 2 components in the open source [Cypress.io](https://www.cypress.io/) test runner + +> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Vue Component Testing Docs](https://docs.cypress.io/guides/component-testing/vue/overview) for mounting Vue components. Installing and importing `mount` from `@cypress/vue2` should only be done for advanced use-cases. + +## [Changelog](./CHANGELOG.md) diff --git a/cli/vue2/package.json b/cli/vue2/package.json new file mode 100644 index 000000000000..d8b66b90c2c7 --- /dev/null +++ b/cli/vue2/package.json @@ -0,0 +1,53 @@ +{ + "name": "@cypress/vue2", + "version": "0.0.0-development", + "description": "Browser-based Component Testing for Vue.js@2 with Cypress.io ✌️🌲", + "main": "dist/cypress-vue2.cjs.js", + "scripts": { + "build": "rimraf dist && yarn rollup -c rollup.config.mjs", + "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js", + "build-prod": "yarn build", + "lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .", + "test": "echo \"Tests for @cypress/vue2 are run from system-tests\"", + "test-ci": "node ../../scripts/run-ct-examples.js --examplesList=./examples.env", + "typecheck": "tsc --noEmit", + "watch": "yarn build --watch --watch.exclude ./dist/**/*" + }, + "devDependencies": { + "@cypress/mount-utils": "0.0.0-development", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-replace": "^2.3.1", + "@vue/test-utils": "^1.3.1", + "tslib": "^2.1.0", + "typescript": "^4.7.4", + "vue": "2.6.12" + }, + "peerDependencies": { + "cypress": ">=4.5.0", + "vue": "^2.0.0" + }, + "files": [ + "dist/**/*", + "src/**/*.js" + ], + "engines": { + "node": ">=8" + }, + "types": "dist/index.d.ts", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/cypress-io/cypress.git" + }, + "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/vue/#readme", + "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fvue&template=1-bug-report.md&title=", + "keywords": [ + "cypress", + "vue" + ], + "unpkg": "dist/cypress-vue2.browser.js", + "module": "dist/cypress-vue2.esm-bundler.js", + "publishConfig": { + "access": "public" + } +} 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..8a11ec3ee8d0 --- /dev/null +++ b/system-tests/__snapshots__/ci_failure_spec_ts.js @@ -0,0 +1,51 @@ +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/package.json b/tooling/v8-snapshot/package.json index fe61f60f8483..4c07b2b763f8 100644 --- a/tooling/v8-snapshot/package.json +++ b/tooling/v8-snapshot/package.json @@ -29,6 +29,7 @@ }, "devDependencies": { "@tooling/system-tests": "0.0.0-development", + "chai-as-promised": "7.1.1", "cpr": "^3.0.1", "mocha": "7.0.1", "snap-shot-it": "7.9.10", 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', From e6d13efcfc8f6599fca9506b797fcc16967c23a6 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 09:44:53 -0500 Subject: [PATCH 02/11] bump cache version --- .circleci/cache-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a7cabdd04385fb0c583b22e5d0c24edef2814229 Mon Sep 17 00:00:00 2001 From: "cypress-bot[bot]" <+cypress-bot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:14:23 +0000 Subject: [PATCH 03/11] index on ryanm/fix/having-trouble-debugging-your-ci-failures-minimal: 55804945c1 fix: ensure having trouble debugging your ci failures message displays From 54f38f7544d4e198ccea6cb6f7630adbccb20089 Mon Sep 17 00:00:00 2001 From: "cypress-bot[bot]" <+cypress-bot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:27:04 +0000 Subject: [PATCH 04/11] index on ryanm/fix/having-trouble-debugging-your-ci-failures-minimal: 55804945c1 fix: ensure having trouble debugging your ci failures message displays From 60acb876eb8c567e583a3bdf5a0657a0043a8171 Mon Sep 17 00:00:00 2001 From: "cypress-bot[bot]" <+cypress-bot[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:50:49 +0000 Subject: [PATCH 05/11] index on ryanm/fix/having-trouble-debugging-your-ci-failures-minimal: 55804945c1 fix: ensure having trouble debugging your ci failures message displays From d714e7209c61a17054d7876d1cf5d2decb0e5c89 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 10:59:21 -0500 Subject: [PATCH 06/11] fix test --- packages/server/__snapshots__/cypress_spec.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 3d92514bcbb7a4e6a7a0fce06bf23c2cb3d92eaa Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 11:09:09 -0500 Subject: [PATCH 07/11] Update tooling/v8-snapshot/package.json --- tooling/v8-snapshot/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tooling/v8-snapshot/package.json b/tooling/v8-snapshot/package.json index 4c07b2b763f8..fe61f60f8483 100644 --- a/tooling/v8-snapshot/package.json +++ b/tooling/v8-snapshot/package.json @@ -29,7 +29,6 @@ }, "devDependencies": { "@tooling/system-tests": "0.0.0-development", - "chai-as-promised": "7.1.1", "cpr": "^3.0.1", "mocha": "7.0.1", "snap-shot-it": "7.9.10", From 0051d5f5b0bcec3c8f85dac0f9431029c27d7529 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 11:18:19 -0500 Subject: [PATCH 08/11] Delete cli/vue2/README.md --- cli/vue2/README.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 cli/vue2/README.md diff --git a/cli/vue2/README.md b/cli/vue2/README.md deleted file mode 100644 index 0dcb604eebaf..000000000000 --- a/cli/vue2/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# @cypress/vue2 - -Mount Vue 2 components in the open source [Cypress.io](https://www.cypress.io/) test runner - -> **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [Vue Component Testing Docs](https://docs.cypress.io/guides/component-testing/vue/overview) for mounting Vue components. Installing and importing `mount` from `@cypress/vue2` should only be done for advanced use-cases. - -## [Changelog](./CHANGELOG.md) From 0eb2ade6a0ff86a9d6bc4b1da518dc5ce5376e3d Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 11:18:29 -0500 Subject: [PATCH 09/11] Delete cli/vue2/package.json --- cli/vue2/package.json | 53 ------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 cli/vue2/package.json diff --git a/cli/vue2/package.json b/cli/vue2/package.json deleted file mode 100644 index d8b66b90c2c7..000000000000 --- a/cli/vue2/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@cypress/vue2", - "version": "0.0.0-development", - "description": "Browser-based Component Testing for Vue.js@2 with Cypress.io ✌️🌲", - "main": "dist/cypress-vue2.cjs.js", - "scripts": { - "build": "rimraf dist && yarn rollup -c rollup.config.mjs", - "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js", - "build-prod": "yarn build", - "lint": "eslint --ext .js,.jsx,.ts,.tsx,.json,.vue .", - "test": "echo \"Tests for @cypress/vue2 are run from system-tests\"", - "test-ci": "node ../../scripts/run-ct-examples.js --examplesList=./examples.env", - "typecheck": "tsc --noEmit", - "watch": "yarn build --watch --watch.exclude ./dist/**/*" - }, - "devDependencies": { - "@cypress/mount-utils": "0.0.0-development", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-replace": "^2.3.1", - "@vue/test-utils": "^1.3.1", - "tslib": "^2.1.0", - "typescript": "^4.7.4", - "vue": "2.6.12" - }, - "peerDependencies": { - "cypress": ">=4.5.0", - "vue": "^2.0.0" - }, - "files": [ - "dist/**/*", - "src/**/*.js" - ], - "engines": { - "node": ">=8" - }, - "types": "dist/index.d.ts", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/cypress-io/cypress.git" - }, - "homepage": "https://github.com/cypress-io/cypress/blob/develop/npm/vue/#readme", - "bugs": "https://github.com/cypress-io/cypress/issues/new?assignees=&labels=npm%3A%20%40cypress%2Fvue&template=1-bug-report.md&title=", - "keywords": [ - "cypress", - "vue" - ], - "unpkg": "dist/cypress-vue2.browser.js", - "module": "dist/cypress-vue2.esm-bundler.js", - "publishConfig": { - "access": "public" - } -} From fe8f8aa64d404f2abd982725d627c220386ae71b Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 11:49:48 -0500 Subject: [PATCH 10/11] Update ci_failure_spec_ts.js --- .../__snapshots__/ci_failure_spec_ts.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/system-tests/__snapshots__/ci_failure_spec_ts.js b/system-tests/__snapshots__/ci_failure_spec_ts.js index 8a11ec3ee8d0..e8cd2f7bca6d 100644 --- a/system-tests/__snapshots__/ci_failure_spec_ts.js +++ b/system-tests/__snapshots__/ci_failure_spec_ts.js @@ -1,29 +1,45 @@ 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 │ @@ -35,17 +51,28 @@ exports['CI failure fails and displays the message that points users to the clou │ 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 + ---------------------------------------------------------------------------------------------------- + ` From 3108936762b361e8785bbda2f3dd1d908c525ee4 Mon Sep 17 00:00:00 2001 From: Ryan Manuel Date: Tue, 22 Apr 2025 11:55:14 -0500 Subject: [PATCH 11/11] rename --- .../{ci_failure_spec_ts.js => ci_failure_spec.ts.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename system-tests/__snapshots__/{ci_failure_spec_ts.js => ci_failure_spec.ts.js} (100%) diff --git a/system-tests/__snapshots__/ci_failure_spec_ts.js b/system-tests/__snapshots__/ci_failure_spec.ts.js similarity index 100% rename from system-tests/__snapshots__/ci_failure_spec_ts.js rename to system-tests/__snapshots__/ci_failure_spec.ts.js