-
Notifications
You must be signed in to change notification settings - Fork 157
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
Second time coverage gives 0% coverage #522
Comments
After investigating a bit more; after doing a
but after a I verified this by hard-coding the
With the hard-coded However, this makes me believe that perhaps it's more of a dotty issue than a sbt-coverage issue? |
I also have seen this issue with a recent little project trying with Scala 3.3.3, ZIO 2.0.19, and Scoverage 2.1.0. On initial setup and run I was getting accurate coverage numbers, but after trying to add some exclusions I began to repeatedly get 0% coverage results. Reverted to original scoverage changeset, and still getting 0%. |
I noticed a peculiar behavior; I fire up
sbt
from the shell and the first time I collect the coverage withclean;coverage;test;coverageAggregate
I get about 37% coverage on my example project but if I run it again immediately after I get 0% and also for all consecutive runs. I obviously expected to get the same coverage every time.If I exit
sbt
and run coverage again I get the same behavior; first run gives correct coverage but consecutive runs give 0%.My test project can be found here: https://github.com/olatheander/scala-code-coverage-test
It seems to be a Scala 3 issue, I created an equivalent Scala 2 project and then it worked as expected.
Below is the output of the first run followed by a second run:
Scala version: 3.3.1
sbt-coverage version: 2.0.9
The text was updated successfully, but these errors were encountered: