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

print coverage report #4

Merged
merged 1 commit into from
Apr 7, 2016
Merged

print coverage report #4

merged 1 commit into from
Apr 7, 2016

Conversation

daviddias
Copy link
Member

This prints the coverage reports after the tests are run. Though adding it as a separate step, but that would mean tests are run twice, which can be very expensive for some of our modules that have very long tests.

Also, by printing the reports but not strictly enforcing a coverage minimum, we make devs aware of how the changes impacted the overall coverage.

What do you think?

@daviddias
Copy link
Member Author

just realised I missed something, give me minutes :)

done :)

@dignifiedquire
Copy link
Member

I'm afraid I'm not happy with this solution, if you instrument tests, the tests take often more than twice as long to run. When you are developing you need to be able to quickly run tests, without wanting the overhead of instrumentation. We can make the default for dignified-test --node be run with coverage and have another option which would be dignified-test --no-coverage to just execute the tests. But there needs to be a way to just run the mocha tests.

@daviddias
Copy link
Member Author

if you instrument tests, the tests take often more than twice as long to run.

really valid point. If the impact is 2x, totally agree that we should have an option to avoid cov

We can make the default for dignified-test --node be run with coverage and have another option which would be dignified-test --no-coverage to just execute the tests. But there needs to be a way to just run the mocha tests.

Let's go with the initial idea of dignified-coverage then.

@daviddias
Copy link
Member Author

dignified-coverage added :)

gulp.task('mocha', ['pre-test'], () => {
return gulp.src([
'test/node.js',
'test/**/*.spec.js'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

13:40 no wait the globs for istanbul need to be the same as for mocha so it doesn't load browser.js

This is the same as https://github.com/dignifiedquire/dignified.js/blob/master/tasks/test/node.js#L12-L13

What else would you like me to add?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant make the one on l12 the same as this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We instrument the src on l12 with Istanbul, and run tests with mocha. We don't need to instrument the tests folder.

@dignifiedquire dignifiedquire merged commit 6895d32 into ipfs:master Apr 7, 2016
@dignifiedquire
Copy link
Member

Thanks :octocat:

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

Successfully merging this pull request may close these issues.

2 participants