sqality / scct

Scala Code Coverage Tool
Apache License 2.0
67 stars 7 forks source link

HtmlReporter breaks with Maven reactor builds #17

Closed ieure closed 10 years ago

ieure commented 11 years ago

I recently split a scala project up into multiple modules, and found that scct no longer determines the source path correctly. Running mvn -Pcoverage clean test causes this exception:

scct: [billyray-cuttlefish-wire] Generating coverage report.
Exception in thread "Thread-3" java.io.FileNotFoundException: /Users/ieure/Projects/billyray-cuttlefish/billyray-cuttlefish-wire/billyray-cuttlefish-wire/src/main/scala/com/billyray-cuttlefish/wire/Balances.scala (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at scala.io.Source$.fromFile(Source.scala:91)
at scala.io.Source$.fromFile(Source.scala:76)
at scala.io.Source$.fromFile(Source.scala:81)
at reaktor.scct.report.SourceLoader.linesFor(SourceLoader.scala:8)
at reaktor.scct.report.SourceFileHtmlReporter$.report(SourceFileHtmlReporter.scala:11)
at reaktor.scct.report.HtmlReporter$$anonfun$sourceFileReports$2.apply(HtmlReporter.scala:92)
at reaktor.scct.report.HtmlReporter$$anonfun$sourceFileReports$2.apply(HtmlReporter.scala:91)
at scala.collection.immutable.TreeMap$$anonfun$foreach$1.apply(TreeMap.scala:160)
at scala.collection.immutable.RedBlack$NonEmpty.foreach(RedBlack.scala:164)
at scala.collection.immutable.RedBlack$NonEmpty.foreach(RedBlack.scala:163)
at scala.collection.immutable.RedBlack$NonEmpty.foreach(RedBlack.scala:163)
at scala.collection.immutable.RedBlack$NonEmpty.foreach(RedBlack.scala:163)
at scala.collection.immutable.TreeMap.foreach(TreeMap.scala:160)
at reaktor.scct.report.HtmlReporter.sourceFileReports(HtmlReporter.scala:91)
at reaktor.scct.report.HtmlReporter.report(HtmlReporter.scala:20)
at reaktor.scct.Coverage$.report(Coverage.scala:58)
at reaktor.scct.Coverage$$anon$1.run(Coverage.scala:67)
ieure commented 11 years ago

I made a minimal project that fails due to this: https://github.com/ieure/hanford

If you run mvn -Pcoverage clean test, it will trigger the bug.

0xRoch commented 11 years ago

@ieure thank you for taking the time to make a sample project

0xRoch commented 11 years ago

@ieure Let me know if it works for you. I'm also going to publish maven-scct-multiproject-report on central. It could be useful if you need to merge the reports.

ieure commented 10 years ago

I finally got a bit to circle back to this, and it is working correctly for me after incorporating the changes made to hanford into my actual project.

Thank you very much for fixing this.

0xRoch commented 10 years ago

@ieure ok great ;-)