Skip to content

coverage of entire project #112

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

Closed
fommil opened this issue Jun 3, 2015 · 8 comments
Closed

coverage of entire project #112

fommil opened this issue Jun 3, 2015 · 8 comments

Comments

@fommil
Copy link

fommil commented Jun 3, 2015

It looks like the coverage report for a module is only gathered for tests run in that module.

I'd like to be able to see the coverage of my entire (multi module) project when I run some integration tests... to see what I can delete 😄 ... is that possible?

@sksamuel
Copy link
Member

sksamuel commented Jun 4, 2015

The sbt coverageAggregate functionality is meant to cover that.

@fommil
Copy link
Author

fommil commented Jun 4, 2015

Hmm, it not sure it does that. I'm seeing 0% coverage outside my top level module

@fommil
Copy link
Author

fommil commented Jun 29, 2015

yeah, coverageAggregate definitely doesn't do what I'm asking. It seems to just join reports together. If I have a project with modules A and B, B depends on A, A doesn't have any tests, B has tests that exercise the entire codebase (including everything in A), then a coverageAggregate will show 0% coverage for module A.

@sksamuel
Copy link
Member

So your tests for A are actually part of B. Then yeah that wouldn't work.
That's like you writing unit tests for scala.collection and wanting code
coverage for that.

On 29 June 2015 at 17:42, Sam Halliday notifications@github.com wrote:

yeah, coverageAggregate definitely doesn't do what I'm asking. It seems
to just join reports together. If I have a project with modules A and B, B
depends on A, A doesn't have any tests, B has tests that exercise the
entire codebase (including everything in A), then a coverageAggregate
will show 0% coverage for module A.


Reply to this email directly or view it on GitHub
#112 (comment)
.

@fommil
Copy link
Author

fommil commented Jun 29, 2015

Yeah, kind of. The point is that I have integration tests (which live in B) and I want to see what parts of the code are dead across the project.

@sksamuel
Copy link
Member

I guess it could be done. Worst case is you could do

sbt compile
sbt test

as two separate things that would result in the profile data. Then

sbt report (or something)

to clean up after.

On 29 June 2015 at 18:02, Sam Halliday notifications@github.com wrote:

Yeah, kind of. The point is that I have integration tests (which live in
B) and I want to see what parts of the code are dead across the project.


Reply to this email directly or view it on GitHub
#112 (comment)
.

@RichardBradley
Copy link
Contributor

Does this workaround fix your case?
#87 (comment)

When run on the example project quoted there, tests in the "core" project add to coverage measured on the "utils" project.

@RichardBradley
Copy link
Contributor

I'm using ver 1.3.1 to produce coverage reports where some of the tests in project A cover classes in project B and it's working well for me.

@fommil fommil closed this as completed Sep 12, 2015
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

3 participants