Open rajeshpg opened 7 years ago
What do you mean by switching coverage strategy?
I guess scoverage considers statement coverage percentage as default to check against minimum coverage. I would like to use branch coverage percentage instead.
I was thinking about new setting, something like that:
lazy val coverageBranchMinimum = settingKey[Double]("minimum branch coverage")
This would be independent of coverageMinimum
setting, with zero as default value for backward compatibility.
To switch
the strategy (as you named it), you would have to set coverageMinimum
value to zero, and coverageBranchMinimum
to value greater than zero. WDYT?
Anyway, I'm blocked with development by this issue. Waiting for the project owner to react. I want this problem to be fixed first.
that'a a great idea. i will try to implement and do PR if you are ok with.
I'd like to have this as well.
Alternatively there could be a new setting like coverageMinimumCheck := Branch
with a default of Statement
for backward compatibility, so there are not two different keys for setting the threshold (unless some people actually want to check/enforce both, then maybe it's beneficial to have two).
To
switch
the strategy (as you named it), you would have to setcoverageMinimum
value to zero, andcoverageBranchMinimum
to value greater than zero. WDYT?
coverageMinimum
already defaults to 0 so you wouldn't need any extra boilerplate to only enable coverageBranchMinimum
, so that approach sounds good to me too. 👍
We have a need for a fine-grained control for coverage minima (similar to various levels supported by JaCoCo for java http://www.jacoco.org/jacoco/trunk/doc/check-mojo.html#rules).
Here's a proposed solution: https://github.com/scoverage/sbt-scoverage/pull/253
I'd also like to have branch coverage. Is there any update on this ticket?
The branch coverage is already part of?PR #253 . Thanks for that @kitbellew
Is there anything stopping it from getting merged?
It would really be great to be able to use it in the next release.
I would like to use branch coverage as the default coverage strategy. So is there a way to switch the coverage strategy.