update ci error msg (#1928)

This commit is contained in:
Ben Kucera
2018-06-20 00:14:15 -04:00
committed by Brian Mann
parent db4a4a6d22
commit f90bfbec90
5 changed files with 65 additions and 6 deletions
+1
View File
@@ -2,6 +2,7 @@ exports['errors individual has the following errors 1'] = [
"nonZeroExitCodeXvfb",
"missingXvfb",
"missingApp",
"notInstalledCI",
"missingDependency",
"versionMismatch",
"binaryNotExecutable",
+22
View File
@@ -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
`
+19
View File
@@ -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,
+3
View File
@@ -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)}
`)
+20 -6
View File
@@ -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())
)
})
})
})