Skip to content
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

What is the purpose of the rake cover_me:report task? #25

Open
sdhull opened this issue Jan 12, 2011 · 1 comment
Open

What is the purpose of the rake cover_me:report task? #25

sdhull opened this issue Jan 12, 2011 · 1 comment

Comments

@sdhull
Copy link

sdhull commented Jan 12, 2011

It's not really clear to me what this does. Is it that it must be run after your tests in order for an accurate report to be generated? I find it odd that after running my test suite, my coverage report is opened in my browser (89% coverage, thankyouverymuch), but if I run rake cover_me:report after that, the coverage report is opened in my browser again, but with 92% coverage.

This would make sense to me if every file had increased somewhat in coverage (as my test suite runs rspec tests and then cucumber tests, and the initial coverage report is opened as the rspec tests are completed), but the numbers just seem to change after running rake cover_me:report: some go up, some go down. Doesn't that seem somewhat odd to you?

Also, a related question: is it possible to programmatically determine the overall coverage percentage? I would love to fail my build if it dips below some arbitrary threshold.

@markbates
Copy link
Owner

Sorry, was incredibly busy all day today. The point of the rake task is to bridge the gap between multiple tasks, such as specs and cucumber. Without it the data from each task was being lost. So this task lets you keep the data between them. It also is there to only report in the data when running all your tests, not just an individual one.

In terms of different percentages coming back, I can't really explain that. I can say that the rake task is not really meant to be run on it's one, but rather wrap the other tasks, so maybe that is part of the problem?

Finally, its not really possible to figure out the percentages during the running of tests, one because you would need to hook into what ever test framework you are using, and two we don't know how much code you have until the very end when the data is all aggregated. Make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants