-
Notifications
You must be signed in to change notification settings - Fork 178
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
Enforce minimum coverage in all test types #305
base: master
Are you sure you want to change the base?
Conversation
… type in `cobertuna, local, html` for backwards compat.
…c based on `ensure_minimum_coverage` flag
957862f
to
a132609
Compare
@parroty ahoy! Any thoughts on this PR? Happy to keep iterating on it if you think there is anything missing? |
Following up on this as well. Ran into this at work and didn't realize that coveralls.json didn't support the minimum coverage. Would love to see it work for that |
Likewise for |
@@ -68,37 +68,4 @@ defmodule ExCoveralls.HtmlTest do | |||
assert(size == @file_size) | |||
end | |||
|
|||
test_with_mock "Exit status code is 1 when actual coverage does not reach the minimum", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vereis Very sorry not being responsive. Could help me understand these removed portion of test codes? The intention is the relevant conditions are covered in other test cases? (just wanted to confirm the exiting behaviors can be maintained if the new options is not specified).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vereis it sounds like we might actually want these removed tests? Possibly adding them to the other coverage types as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi sorry for the delays... not sure how I missed all these emails.
Yes so these tests were removed as the coverage checking is no longer coupled to a given coverage type.
It would be a good idea to test this at a higher level rather than in each type... but yeah in lieu of that we could add these tests to each type.. that just sounds more painful than necessary haha
Happy to circle back around to this in the near future as I've got some time off 😆
Hey! I'm very interested on these changes. Any plans to merge it anytime soon? |
Hello! What is the status of this PR? Is there anything blocking this from merging? |
I'm sorry being not responsive. I appreciate any help resolving conflicts. |
Ahoy again!
This PR implements a new flag to
excoveralls
:--enforce-minimum-coverage
. When this is provided, we always runStats.ensure_minimum_coverage/1
regardless of what testing type you're running.For example:
I've refactored the existing type implementations that call
Stats.ensure_minimum_coverage/1
by default and removed these calls. Instead, when runningMix.Tasks.Coveralls.do_run/2
I check to see if the type requested was eitherhtml
,local
, orcobertuna
and if so, I automatically set--enforce-minimum-coverage
to retain backwards behavioural compatibility.Closes #297