Skip to content

Aggregating coverage results doesn't work if the project has just one scoverage.xml file #144

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
mthmulders opened this issue Nov 27, 2015 · 3 comments

Comments

@mthmulders
Copy link

Not sure whether this is a bug or a feature... But I feel like it's a bug.

I have a SBT-project in the being, which currently has just one submodule. But it will have more the in the future, so that's why I figured multi-project setup would be appropriate.

Running sbt coverageAggregate gives the following output:

[info] Aggregating coverage from subprojects...
[info] Found 1 subproject report files [<project dir>/<submodule dir>/target/scala-2.11/scoverage-report/scoverage.xml]
[info] No subproject data to aggregate, skipping reports

It makes sense, since CoverageAggregator#aggregate explicitly checks to see if more than one file has been found.

I'd expect that aggregation of results also works if exactly one file would've been found.

If this is indeed a bug, let me know, I think I can contribute a simple PR for this 😃.

@pasviegas
Copy link

So, I ran into this, and it seems to be a bug to me. I had 2 sub projects, but just one with a actual test suite, and I couldnt send my reports to coverall because coverall only gets the reports from the base project, so I had to create a fake test in my sub project just make this work.

@zzztimbo
Copy link

This is a bug.

@parkan
Copy link
Contributor

parkan commented Mar 21, 2016

parkan added a commit to parkan/scalac-scoverage-plugin that referenced this issue Mar 21, 2016
If only one scoverage.xml file is found, the aggregator refuses to produce output:

[info] Found 1 subproject report files [/Users/arkadiy/mine/L-SPACE/l_space/target/scala-2.11/scoverage-report/scoverage.xml]
[info] No subproject data to aggregate, skipping reports

This allows aggregation of a single file

Fixes scoverage#144
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

4 participants