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

Avoiding coverage shadowing between modules #419

Open
vlfig opened this issue Jan 28, 2022 · 0 comments
Open

Avoiding coverage shadowing between modules #419

vlfig opened this issue Jan 28, 2022 · 0 comments

Comments

@vlfig
Copy link

vlfig commented Jan 28, 2022

Hi,

In a multi-module build we can have a situation where one module's tests exercise code paths of another module it depends on. If we're not careful, this could shadow uncovered code in the depended module, depending on the relative order of their tests in CI.

Let's say,

  1. a depends on b;
  2. we test a then b;
  3. testing a exercises a code path in b which b does not exercise by itself;
  4. coverage report for b will indicate that code path as covered.

If we're strict about the modules' interfaces, we'd want their coverage to be guaranteed by their own tests, not their dependents'.

Running rm b/target/scala-2.13/scoverage-data/scoverage.measurements* between test invocations seems to do the job, but I wondered if an Sbt Task wouldn't be more appropriate or even if there was a way to avoid writing those measurements to dependencies' $coverageDataDir in the first place.

Thank you

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

No branches or pull requests

1 participant