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

Paths are wrong in aggregate reports. #93

Closed
hrj opened this issue Feb 14, 2015 · 11 comments
Closed

Paths are wrong in aggregate reports. #93

hrj opened this issue Feb 14, 2015 · 11 comments

Comments

@hrj
Copy link

hrj commented Feb 14, 2015

In the aggregate report, the path for an individual file's report, is wrong:

It should be: project/subproject/target/scala-2.11/package/file.scala.html

But it ends up being: project/subproject/src/main/scala/package/file.scala.html

@hrj hrj changed the title Path are wrong in aggregate reports. Paths are wrong in aggregate reports. Feb 14, 2015
@hrj
Copy link
Author

hrj commented Feb 14, 2015

Digging deeper, I noticed something else:

There is directory tree under target/scala-2.11/scoverage-report which mimics the absolute path of the project. For example, if the scala project was in this directory: /home/user/myproject then the directory created is /home/user/myproject/target/scala-2.11/scoverage-report/home/user/myproject/subproject/src/main/scala/package/file.scala.html. Phew!

So, the link in the aggregate coverage report has mixed different paths together.

Aside, I suggest not using the absolute path in the report, since it leaks information not related to the project, when I am sharing the report to someone. For example, if I checkout a project under /home/hrj/junk/project or under /clientX/proj, the one who sees the report knows how well I respect the project or which client I work for, etc.

@gslowikowski
Copy link
Member

scoverage/scalac-scoverage-plugin#109 + #98 should fix this issue

@VladUreche
Copy link

FYI, I also bumped into this. Another problem was that if I run coverageAggregate before running coverageReport for the subprojects, sbt-scoverage loses all coverage data and shows 0% covered. As a workaround, I run coverageReport followed by coverageAggregate: miniboxing/miniboxing-plugin@5cec361#diff-354f30a63fb0907d4ad57269548329e3R3

@VladUreche
Copy link

Possibly related: #69.

@gslowikowski
Copy link
Member

Try 1.0.5-SNAPSHOT version please, add:

resolvers ++= Seq( Classpaths.sbtPluginSnapshots, Resolver.sonatypeRepo("snapshots") )

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.5-SNAPSHOT")

to your project/plugins.sbt file.

@VladUreche
Copy link

@gslowikowski Thanks! Linking works fine, but I still get 0.00% for the coverage everywhere.

@VladUreche
Copy link

To reproduce the problem, here's what I do:

$ git checkout https://github.com/miniboxing/miniboxing-plugin.git
$ cd miniboxing-plugin
$ git checkout sbt-scoverage-snapshot
$ sbt
> clean
> coverage
> test
> coverageAggreagate
> coverageReport
> coverageAggreagate

The first coverageAggregate shows 0.00% coverage everywhere. The second coverageAggregate shows the correct coverage. I would expect it to show the correct coverage the first time, without requiring me to go through coverageReport.

@gslowikowski
Copy link
Member

Are you testing on miniboxing-plugin, wip branch? What SBT command do you execute?

@gslowikowski
Copy link
Member

Thanks :)

@VladUreche
Copy link

@gslowikowski thank you for looking into it :)

@ckipp01
Copy link
Member

ckipp01 commented Apr 29, 2021

I believe this should be fixed. If you still have an issue with the please do report back.

@ckipp01 ckipp01 closed this as completed Apr 29, 2021
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