feat: add CYPRESS_SKIP_VERIFY option to suppress verification (#29836)

* misc: add `CYPRESS_SKIP_VERIFY` option to suppress verification

* Update CHANGELOG.md

* Move changelog entry to feature

* Whoops - features

* Update CHANGELOG.md

* Update cli/lib/tasks/verify.js

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

* Update cli/lib/tasks/verify.js

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

* Update cli/lib/tasks/verify.js

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

* Appease the linter

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
This commit is contained in:
Josh Ward
2024-08-16 17:45:34 +01:00
committed by GitHub
parent 8b54d3e919
commit 482358b824
3 changed files with 22 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
<!-- See the ../guides/writing-the-cypress-changelog.md for details on writing the changelog. -->
## 13.13.4
## 13.14.0
_Released 8/27/2024 (PENDING)_
@@ -7,6 +7,10 @@ _Released 8/27/2024 (PENDING)_
- Fixed a potential memory leak in the Cypress server when re-connecting to an unintentionally disconnected CDP connection. Fixes [#29744](https://github.com/cypress-io/cypress/issues/29744). Addressed in [#29988](https://github.com/cypress-io/cypress/pull/29988)
**Features:**
- Added a `CYPRESS_SKIP_VERIFY` flag to enable suppressing Cypress verification checks. Addresses [#22243](https://github.com/cypress-io/cypress/issues/22243).
**Dependency Updates:**
- Updated `detect-port` from `1.3.0` to `1.6.1`. Addressed in [#30038](https://github.com/cypress-io/cypress/pull/30038).

View File

@@ -258,8 +258,15 @@ const start = (options = {}) => {
force: false,
welcomeMessage: true,
smokeTestTimeout: VERIFY_TEST_RUNNER_TIMEOUT_MS,
skipVerify: util.getEnv('CYPRESS_SKIP_VERIFY') === 'true',
})
if (options.skipVerify) {
debug('skipping verification of the Cypress app')
return Promise.resolve()
}
if (options.dev) {
return runSmokeTest('', options)
}

View File

@@ -97,6 +97,16 @@ context('lib/tasks/verify', () => {
expect(newVerifyInstance.VERIFY_TEST_RUNNER_TIMEOUT_MS).to.eql(DEFAULT_VERIFY_TIMEOUT)
})
it('returns early when `CYPRESS_SKIP_VERIFY` is set to true', () => {
process.env.CYPRESS_SKIP_VERIFY = 'true'
delete require.cache[require.resolve(`${lib}/tasks/verify`)]
const newVerifyInstance = require(`${lib}/tasks/verify`)
return newVerifyInstance.start().then((result) => {
expect(result).to.eq(undefined)
})
})
it('logs error and exits when no version of Cypress is installed', () => {
return verify
.start()