New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Coveralls configuration #1277
Conversation
The error in this build is due to |
It's not clear to me what this error is, so what is the next step on this? And, our code coverage isn't really that bad, is it? According to what you posted here we are at around 75%. |
You need to login to coveralls.io with your GitHub account, then find the request project in the list of request org projects, and click on the button to enable it. You need to be an owner of that org. Coveralls token requests only read access to your email, so it can't modify anything on your behalf on GitHub like Travis-CI do. Once you enable the request project on coveralls.io the script from the travis.yml will send the lcov data from our tests successfully (or at least it works that way for me on my personal projects) Currently the test coverage is around 80% for the entire request.js file. |
Done, and I restarted the Travis build. |
Oh and as it stands the new build script disables the lint check on Travis, which I think we want to keep. |
The build failed again for some reason. I don't even see the tests output. |
This is what I have in my project language: node_js
node_js:
- 0.8
- 0.10
script: ./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha test/core --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js --verbose and "scripts": {
"test": "node_modules/mocha/bin/mocha test/core --require should --reporter spec --timeout 10000"
} npm test is executed first, then the travis.yml script. For some reason npm test is not executed for request. |
The travis docs say that
|
Makes sense, it seems that it works by magic for my project 😀 Not let's see how it goes. |
Oh wait it's exactly the same for my project too, it's just that I use the exact same parameters for my tests, so I'm seeing the exact same output. |
@nylen I tried generating the lcov data through istanbul cover ./node_modules/.bin/taper tests/test-*.js All tests are passing but the output is Then I tried using istanbul cover ./node_modules/.bin/tape tests/test-*.js So I'm not entirely sure what is going on. In |
It's probably because |
Yep, that seems to be the case, found similar issue solved in this module https://github.com/KenPowers/gulp-spawn-mocha#code-coverage Any idea how this can be easily fixed in |
That's by design, to be able to detect timeouts which is a problem with You should be able to execute all the test files without using a runner though. And I can't think of a reason why I don't think it would be that difficult to add an option not to use subprocesses, but I probably won't have any time to look at this for at least a week (until I get back from vacation). |
Running each test one by one with |
Here, maybe this will help: http://www.gamefudge.com/bash-the-computer More seriously though, I wonder if some test file is "finishing" before one of its servers is closing? That would explain why it works as a separate process, since the process wouldn't end until all the servers close. |
Thanks for the heads up! It appears to be a So removing both of them gives me this coverage (of course this is not representative of the actual test coverage) So either Nice game, I should do that more often.. or take the harder route. No idea which one 😀 |
Ah, yeah that makes sense. Does For |
Changes Unknown when pulling 37e2268 on simov:test-coverage into * on request:master*. |
So I ended up wrapping the whole thing in an One of the pipe tests was missing In short the above coverage includes all of the tests except the |
Will this message be displayed for every change, even if you insert missing comma in README? 'cause as I've seen in other projects, @coveralls can be extremely annoying. |
Yeah I can understand that, still it's a good idea to have some form of automatic notification. They have a bunch of other notification options as well So it might be a good idea to check them out too. The reason for all of this is that I missed one of the conditional branched in one of my previous PR's and this resulted in a non caught bug. |
@nylen I think this is good to be merged in. It contains a few bugfixes for the tests, and probably coveralls notifications can be set to write to gitter for example (in case github comment are too annoying) |
@simov thanks for the reminder, can you look into the merge conflict? |
Conflicts: .gitignore
Changes Unknown when pulling 9c5fbd3 on simov:test-coverage into * on request:master*. |
@nylen resolved. Probably the coverall comments can get annoying idd. I think writing to Gitter via web hook is a good option. |
Thanks @simov, this is going to be nice to have. Let's see how PR comments go for a while, then address that later if they get too annoying. |
@simov +1 on moving converalls out of the PR comments themselves and into gitter or travis output. I've seen a few complaints of how noisy it is while they never seem to add much value to the PR |
The build just have to fail if the coverage is going down, not sure if that's possible though. |
Per discussion on Gitter and in request#1277 we want to disable Coveralls PR comments. Add a Coveralls badge so that we still watch coverage stats. While we're at it, add a Travis badge, and make all badges the same style.
Okay, coveralls comments on PRs should be disabled now. I think getting Coveralls output into somewhere else would be a bit of work. I've submitted #1343 to add a coverage badge to the readme. If @coveralls doesn't show up in there then we should be good to go. |
OK now they're really disabled. |
@nylen you just need to enable coveralls for the request project on https://coveralls.io, other than that technically it should work. I tried it on one of my projects with mocha instead of tape and it seems to be fine.
Also you can try this line out
./node_modules/.bin/istanbul cover ./node_modules/tape/bin/tape tests/test-*.js
This will generate a nice html output in
coverage/lcov-report/index.html
, so you can check the output locally as well.