mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-06 15:00:50 -05:00
update ci error msg (#1928)
This commit is contained in:
@@ -2,6 +2,7 @@ exports['errors individual has the following errors 1'] = [
|
||||
"nonZeroExitCodeXvfb",
|
||||
"missingXvfb",
|
||||
"missingApp",
|
||||
"notInstalledCI",
|
||||
"missingDependency",
|
||||
"versionMismatch",
|
||||
"binaryNotExecutable",
|
||||
|
||||
@@ -266,3 +266,25 @@ Platform: darwin (Foo-OsVersion)
|
||||
Cypress Version: 1.2.3
|
||||
|
||||
`
|
||||
|
||||
exports['error binary not found in ci 1'] = `
|
||||
Error: The cypress npm package is installed, but the Cypress binary is missing.
|
||||
|
||||
We expected the binary to be installed here: /cache/Cypress/1.2.3/Cypress.app/Contents/MacOS/Cypress
|
||||
|
||||
Reasons it may be missing:
|
||||
|
||||
- You're caching 'node_modules' but are not caching this path: /cache/Cypress
|
||||
- You ran 'npm install' at an earlier build step but did not persist: /cache/Cypress
|
||||
|
||||
Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.
|
||||
|
||||
Alternatively, you can run 'cypress install' to download the binary again.
|
||||
|
||||
https://on.cypress.io/not-installed-ci-error
|
||||
----------
|
||||
|
||||
Platform: darwin (Foo-OsVersion)
|
||||
Cypress Version: 1.2.3
|
||||
|
||||
`
|
||||
|
||||
@@ -45,6 +45,24 @@ const binaryNotExecutable = (executable) => ({
|
||||
})
|
||||
|
||||
|
||||
const notInstalledCI = (executable) => ({
|
||||
description: 'The cypress npm package is installed, but the Cypress binary is missing.',
|
||||
solution: stripIndent`\n
|
||||
We expected the binary to be installed here: ${chalk.cyan(executable)}
|
||||
|
||||
Reasons it may be missing:
|
||||
|
||||
- You're caching 'node_modules' but are not caching this path: ${util.getCacheDir()}
|
||||
- You ran 'npm install' at an earlier build step but did not persist: ${util.getCacheDir()}
|
||||
|
||||
Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.
|
||||
|
||||
Alternatively, you can run 'cypress install' to download the binary again.
|
||||
|
||||
https://on.cypress.io/not-installed-ci-error
|
||||
`,
|
||||
})
|
||||
|
||||
const nonZeroExitCodeXvfb = {
|
||||
description: 'XVFB exited with a non zero exit code.',
|
||||
solution: stripIndent`
|
||||
@@ -216,6 +234,7 @@ module.exports = {
|
||||
nonZeroExitCodeXvfb,
|
||||
missingXvfb,
|
||||
missingApp,
|
||||
notInstalledCI,
|
||||
missingDependency,
|
||||
versionMismatch,
|
||||
binaryNotExecutable,
|
||||
|
||||
@@ -25,6 +25,9 @@ const checkExecutable = (binaryDir) => {
|
||||
}
|
||||
})
|
||||
.catch({ code: 'ENOENT' }, () => {
|
||||
if (util.isCi()) {
|
||||
return throwFormErrorText(errors.notInstalledCI(executable))()
|
||||
}
|
||||
return throwFormErrorText(errors.missingApp(binaryDir))(stripIndent`
|
||||
Cypress executable not found at: ${chalk.cyan(executable)}
|
||||
`)
|
||||
|
||||
@@ -394,15 +394,29 @@ context('lib/tasks/verify', () => {
|
||||
packageVersion,
|
||||
})
|
||||
util.isCi.returns(true)
|
||||
|
||||
return verify.start({ force: true })
|
||||
})
|
||||
|
||||
it('uses verbose renderer', () => {
|
||||
snapshot(
|
||||
'verifying in ci',
|
||||
normalize(stdout.toString())
|
||||
)
|
||||
return verify.start()
|
||||
.then(() => {
|
||||
snapshot(
|
||||
'verifying in ci',
|
||||
normalize(stdout.toString())
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
it('logs error when binary not found', () => {
|
||||
mockfs({})
|
||||
return verify.start()
|
||||
.then(() => { throw new Error('Should have thrown') })
|
||||
.catch((err) => {
|
||||
logger.error(err)
|
||||
snapshot(
|
||||
'error binary not found in ci',
|
||||
normalize(stdout.toString())
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user