oyvindberg/bleep

Strange issue when making ScoverageReport for bleep

markehammons opened this issue ยท 3 comments

(In my implementation of Scoverage Reporting)[https://gist.github.com/markehammons/ab20ae70aa74c1391008c99f1a49a8eb] for bleep, I ran into an odd issue I had to hack around. The hack occurs at lines 42-59 of the ScoverageReport.scala file in that gist.

The essence of the problem is that the -coverage-out: flag is generating scoverage data with paths that look like ../home/mhammons/Documents/slinc/core/src/scala/the/rest/of/the/absolute/path instead of the core/src/scala/the/rest/of/the/relative/path scoverage needs to generate the reports. The solution I've hacked in is to read the file, look for lines starting with ../ and replace them with a path that strips out the .. at the beginning and relativizes the path with the buildDir.

Any thoughts on why this could be happening?

Hopefully what I suggested in #320 will help you out here?

Hi @oyvindberg. Sorry for the very late reply, I halted use of bleep in my currently existing library, and started using it in a new one. With regards to that, I have tested my scoverage script/plugin on this new library, and sadly it doesn't solve the issue. Here's the current version of my code: https://github.com/markehammons/bleep-plugins

The scoverage modification code is on lines 42-68 of ScoverageReport.scala. I have it warn and show the original lines if it detects a malformed path (absolute path that starts with "../"). Here's the output on a recent run:

๐Ÿ“™ BSP / [script ScoverageReport]: /home/mhammons/Documents/xperimenta/.bleep/builds/add-coverage/.bloop/core/scoverage-report/scoverage.coverage@22 is malformed!!
๐Ÿ“— BSP / [script ScoverageReport]: original line: ../home/mhammons/Documents/xperimenta/core/src/scala/fr/hammons/xperimenta/core/Structural.scala
๐Ÿ“™ BSP / [script ScoverageReport]: /home/mhammons/Documents/xperimenta/.bleep/builds/add-coverage/.bloop/core/scoverage-report/scoverage.coverage@39 is malformed!!
๐Ÿ“— BSP / [script ScoverageReport]: original line: ../home/mhammons/Documents/xperimenta/core/src/scala/fr/hammons/xperimenta/core/Structural.scala
๐Ÿ“™ BSP / [script ScoverageReport]: /home/mhammons/Documents/xperimenta/.bleep/builds/add-coverage/.bloop/core/scoverage-report/scoverage.coverage@56 is malformed!!
๐Ÿ“— BSP / [script ScoverageReport]: original line: ../home/mhammons/Documents/xperimenta/core/src/scala/fr/hammons/xperimenta/core/Structural.scala
๐Ÿ“™ BSP / [script ScoverageReport]: /home/mhammons/Documents/xperimenta/.bleep/builds/add-coverage/.bloop/core/scoverage-report/scoverage.coverage@73 is malformed!!
๐Ÿ“— BSP / [script ScoverageReport]: original line: ../home/mhammons/Documents/xperimenta/core/src/scala/fr/hammons/xperimenta/core/Structural.scala

The proper format is something like: core/src/scala/fr/hammons/xperimenta/core/Structural.scala. I'm not really sure why this is happening, and it may be more of a compiler bug than a bug with bleep, but I was wondering if you had any insight into this.

I don't really know.

Here are what I would look into:

  • You can manually inspect the generated bloop files inside /home/mhammons/Documents/xperimenta/.bleep/builds/add-coverage/.bloop to see that the path in the scalacOption is generated like you want
  • You can debug scripts in your IDE, so if the error is in your code it should be easy to find that way
  • If both of those look ok it's likely your usage of the coverage plugin which differs from how it should be used, or some assumption it was written with which no longer holds in this world.