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

feat(reporter): add check coverage thresholds #141

Merged

Conversation

nmalaguti
Copy link
Contributor

Add check option to coverageReporter options. Supports similar
options to istanbul's check-coverage feature.

It will cause karma to return a non-zero exit code if coverage
thresholds are not met.

Closes #21

coverageReporter: {
check: {
global: {
statements: 50,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this threshold? Red to Yellow, or Yellow or Green?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The check thresholds are separate from the watermark thesholds, so the colors have no impact on whether the check will pass or fail.

The Istanbul tool also keeps them separate.

@nmalaguti
Copy link
Contributor Author

Please review and merge this. Thanks.

Let me know if there is any additional information I can provide.

@nmalaguti
Copy link
Contributor Author

What is the process for getting this reviewed?

@stramel
Copy link
Contributor

stramel commented May 5, 2015

@nmalaguti From my experience, waiting or pestering them until they do it. I had a PR that sat out here for months.

@maksimr
Copy link
Contributor

maksimr commented May 5, 2015

@nmalaguti , @stramel sorry guys. I really should spend some time to review because I dont use coverage(karma-coverage) and It's hard understand on the fly what this code do

Thanks!

@nmalaguti
Copy link
Contributor Author

Let me know if there's anything I can do to add some context to the change.

@nmalaguti
Copy link
Contributor Author

Following up on this.

@nmalaguti
Copy link
Contributor Author

@maksimr I wanted to follow up on this and see if we can get this merged in and released.

@stramel
Copy link
Contributor

stramel commented Jun 1, 2015

@nmalaguti Way to be persistent 👍

@dignifiedquire
Copy link
Member

I haven't gotten to karma-coverage yet, but will try to get to it this week, if @maksimr doesn't get to it first

@nmalaguti
Copy link
Contributor Author

@dignifiedquire @maksimr any chance this can be merged this week?

@nmalaguti
Copy link
Contributor Author

@dignifiedquire @maksimr following up on this PR.

/*
Copyright (c) 2012, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
Copy link
Member

Choose a reason for hiding this comment

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

Why are you adding these license blocks?

@nmalaguti
Copy link
Contributor Author

The code to calculate coverage was sourced from https://github.com/gotwarlost/istanbul/blob/master/lib/command/check-coverage.js and modified to work in karma. I'm giving proper attribution to the code.

@dignifiedquire
Copy link
Member

I'm all for giving attribution, but it's not really helpful to have these multiple license blocks, with references to a license file that doesn't even exist in this code base. I suggest you add a header to the file saying something like

// Part of this code is based on [1], which is licensed under the new BSD license
// For more information see the license accompanying [1]
// 
// [1]: https://github.com/gotwarlost/istanbul/blob/master/lib/command/check-coverage.js

@dignifiedquire
Copy link
Member

Also need another rebase after I merged some PRs

@nmalaguti
Copy link
Contributor Author

Rebased. I added the BSD license to the LICENSE file so that it will be distributed with the code. I also added the suggested comment to the top.

@dignifiedquire
Copy link
Member

Please put the license in a different file, something like LICENSE-istanbul, to make the references clearer.

@dignifiedquire
Copy link
Member

That change and one more rebase and I can push it out for a new release :)

Add check option to coverageReporter options. Supports similar
options to istanbul's check-coverage feature.

It will cause karma to return a non-zero exit code if coverage
thresholds are not met.

Closes karma-runner#21
@nmalaguti
Copy link
Contributor Author

Rebased and moved LICENSE.

dignifiedquire added a commit that referenced this pull request Jun 9, 2015
feat(reporter): add check coverage thresholds
@dignifiedquire dignifiedquire merged commit c3e824d into karma-runner:master Jun 9, 2015
@dignifiedquire
Copy link
Member

Thanks for all the work!

@nmalaguti nmalaguti deleted the feature/check-coverage branch June 14, 2015 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding a 'checkCoverage' option to compare coverage with a defined threshold
4 participants