Travis.ci false positive result ?
jaumard opened this issue · comments
I use this command to run tests babel-node node_modules/.bin/isparta cover _mocha
and here the output :
npm test
> babel-node node_modules/.bin/isparta cover _mocha
module:app
Should create app from archetype
1) "before all" hook
0 passing
1 failing
1) module:app Should create app from archetype "before all" hook:
Uncaught Error: ENOENT: no such file or directory, access '/private/var/folders/w8/79t7n_v96kx42lrn_7sm8k2c0000gn/T/df978e3a519fe5db4ca90e6080d6f0c62e0a8ed8/node_modules/mymodule'
at Error (native)
at Object.fs.accessSync (fs.js:203:11)
at /src/app/steps/writing.js:9:2043
at AppGenerator.install.runInstall (/node_modules/yeoman-generator/lib/actions/install.js:39:5)
at AppGenerator.install [as npmInstall] (/node_modules/yeoman-generator/lib/actions/install.js:160:15)
at AppGenerator.serverDependentApi (/src/app/steps/writing.js:9:1668)
at /node_modules/yeoman-generator/lib/base.js:430:16
at processImmediate [as _immediateCallback] (timers.js:374:17)
================================================================================
Writing coverage object [/coverage/coverage.json]
Writing coverage reports at [/coverage]
================================================================================
=============================== Coverage summary ===============================
Statements : 91.37% ( 773/846 ), 28 ignored
Branches : 85.21% ( 242/284 ), 82 ignored
Functions : 91.71% ( 166/181 )
Lines : 77.61% ( 253/326 )
================================================================================
But on travis.ci build is marked as passed even tests are not. Any way to don't run coverage if mocha tests are failing ? Or do I need to change something in order to travis.ci to detect tests are failed.
I can confirm I have the same problem, but the last commit is dated Nov 14 2015
. Could it be one of the dependencies that is causing this problem.
@emmenko Not sure, I'm going to have to investigate myself as @douglasduteil doesn't seem to have been active lately.
Awesome, thanks!! 👍
@emmenko This fixes it for me: https://github.com/nathanmarks/isparta/tree/remove-process-exit-0
The process.exit(0)
was stopping exit codes from process.on('exit')
handlers in the test harness from passing through properly.
@douglasduteil Any planned date for solve this on the main repo, so we could npm-install it fixed?
Thanks.
@pritok I've moved on to the alpha version of istanbul which works better than this lib anyways. Check out my setup here: https://github.com/callemall/material-ui
Thanks @nathanmarks !! I was trying to fix a false test error with Travis when I run coverage (on local machine works like a charm). The error is still there though, so maybe I've messed it up somewhere else. Anyways thank you for your help!