You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running sbt clean coverage test coverageReport, all tests still pass, but the subsequent coverageReport task fails. The cause seems to be the stdLibPatches made to Predef.scala to enable the explicit nulls feature.
[info] Waiting for measurement data to sync...
[info] Reading scoverage instrumentation [/Users/laufer/Dropbox/Home/Work/teaching/cs371/sbt-scoverage-samples/target/scala-3.2.0/scoverage-data/scoverage.coverage]
[info] Reading scoverage measurements...
[info] Generating scoverage reports...
[info] Written Cobertura report [/Users/laufer/Dropbox/Home/Work/teaching/cs371/sbt-scoverage-samples/target/scala-3.2.0/coverage-report/cobertura.xml]
[info] Written XML coverage report [/Users/laufer/Dropbox/Home/Work/teaching/cs371/sbt-scoverage-samples/target/scala-3.2.0/scoverage-report/scoverage.xml]
[error] java.lang.RuntimeException: No source root found for '/Users/laufer/Dropbox/Home/Work/teaching/cs371/sbt-scoverage-samples/library/src/scala/runtime/stdLibPatches/Predef.scala' (source roots: '/Users/laufer/Dropbox/Home/Work/teaching/cs371/sbt-scoverage-samples/src/main/scala/')
...
The text was updated successfully, but these errors were encountered:
Thanks for the report @klaeufer although I'm a bit surprised by the issue. The coverer samples has some odd stuff going on, so it actually might be better to provide a hello world project with a very minimal reproduction just to confirm this happens on a fresh project using 3.2.x and these settings. Locally trying it out on a hello world project I didn't have that issue.
sbt-scoverage seems to be incompatible with Scala 3's explicit nulls language feature.
I first made some minimal changes to convert sbt-scoverage-samples to explicit nulls:
https://github.com/scoverage/sbt-scoverage-samples/compare/main...klaeufer:sbt-scoverage-samples:scala3-explicit-nulls?expand=1
When running
sbt clean coverage test coverageReport
, all tests still pass, but the subsequent coverageReport task fails. The cause seems to be the stdLibPatches made to Predef.scala to enable the explicit nulls feature.The text was updated successfully, but these errors were encountered: