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

Support Scoverage for Scala 3 #2016

Merged
merged 4 commits into from
Sep 28, 2022
Merged

Conversation

ckipp01
Copy link
Contributor

@ckipp01 ckipp01 commented Sep 3, 2022

This is a follow-up to the work done in #2010 to also add support for Scala 3.

class ScoverageData(ctx0: mill.define.Ctx) extends Module()(ctx0) with ScalaModule {

/** Coverage in the Scala 3 compilier is only supported in the 3.2.x series and above. */
private def isSupportedScala: Task[Boolean] = T.task {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I'm having a hard time with is figuring out where to put this check. At first I thought it'd be better to put it up above and in every task that computes something I could use like

    private def ensureValidScala3[A](value: A): Task[A] = T.task {
      val scalaVersion = outer.scalaVersion()
      scalaVersion.split('.') match {
        case Array(major, minor, patch) if major == "3" && minor.toIntOption.exists(_ >= 2) => value
        case Array(major, minor, patch) if major == "3" =>
          val msg =
            s"Detected Scala version: ${scalaVersion}. However, to use Coverage with Scala 3 you must be at least on Scala 3.2.0."
          Result.Failure(msg)
        case _ => value
      }
    }

So then I could just do like:

  def scoverageRuntimeDeps: T[Agg[Dep]] = T {
    if (isScala3()) {
      ensureValidScala3(Agg.empty)()
    } else {
      Agg(ivy"org.scoverage::scalac-scoverage-runtime:${outer.scoverageVersion()}")
    }
  }

But that fell apart when I hit scoveragteToolsClasspath and couldn't get it to work.

Then I moved this down below into ScoverageData and I thought about adding an assert in here to check for an invalid Scala 3, but can't really access the scalaVersion in the assert. I'm not really sure where to do this check. Any input on where you'd think this would be best and how to do it?

Copy link
Contributor Author

@ckipp01 ckipp01 Sep 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover this should also check that if this is a valid Scala 3 version then the user must also be using scoverage 2.x. It'd be nice to do this check in one place.

Copy link
Member

@lefou lefou Sep 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this check is best placed in scoverageToolsClasspath. It has access to all required data and is run before any worker action. Also, as there can be no valid classpath created in case we have an incompatible Scala version or an inappropriate scoverage version, this is the best place for this validation.

@@ -212,19 +251,26 @@ object HelloWorldTests_2_12 extends HelloWorldTests {
override def threadCount = Some(1)
override def testScalaVersion: String = sys.props.getOrElse("MILL_SCALA_2_12_VERSION", ???)
override def testScoverageVersion = sys.props.getOrElse("MILL_SCOVERAGE_VERSION", ???)
override def testScalatestVersion = "3.0.8"
override def testScalatestVersion = "3.2.13"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up having to bump all these because 3.0.8 doesn't support Scala 3.

@lefou lefou self-requested a review September 5, 2022 09:39
@lefou
Copy link
Member

lefou commented Sep 19, 2022

@ckipp01 Do you mind when I update your PR with some changes? As I needed to check it out for a proper review, I already started to think by changing some code.

@lefou lefou changed the title feat: support scoverage for Scala 3 Support Scoverage for Scala 3 Sep 19, 2022
@ckipp01
Copy link
Contributor Author

ckipp01 commented Sep 19, 2022

@ckipp01 Do you mind when I update your PR with some changes? As I needed to check it out for a proper review, I already started to think by changing some code.

Hey! Of course, I'm on holiday at the moment so I won't be looking closely at it for another couple weeks probably.

@lefou lefou linked an issue Sep 21, 2022 that may be closed by this pull request
@lefou
Copy link
Member

lefou commented Sep 21, 2022

Don't know why the Scala 3.2 test fails. Maybe, something changed in Scala itself?

@lefou lefou removed their request for review September 27, 2022 15:37
@lefou
Copy link
Member

lefou commented Sep 27, 2022

I still have no idea why the htmlReport test is failing with Scala 3.2. The issue is, that a path for the test setup is not correct. This should be no issue in normal usage though, so I tend to just disable this test for now and merge anyway. If anybody has an idea, please help.

@lefou lefou marked this pull request as ready for review September 27, 2022 19:20
I don't know why this fails, but htmlReport seems to work in normal usage.
@lefou lefou merged commit c9c409e into com-lihaoyi:main Sep 28, 2022
@lefou lefou added this to the after 0.10.7 milestone Sep 28, 2022
@ckipp01 ckipp01 deleted the coverageScala3 branch September 28, 2022 09:12
@carlosedp
Copy link
Contributor

@lefou, in my project, I'm getting the No source root found for error on htmlReportAll. As seen, consoleReportAll and xmlReportAll works fine!

My project build is on: https://github.com/carlosedp/riscvassembler/blob/main/build.sc

Log:

[155/155] linter.consoleReportAll
Processing coverage data for 3 data locations
[info] Found 3 subproject scoverage data directories [/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/workerModule/scoverage/data.dest]
Statement coverage.: 78.28%
Branch coverage....: 57.14%
❯ mill linter.htmlReportAll
[155/155] linter.htmlReportAll
Processing coverage data for 3 data locations
[info] Found 3 subproject scoverage data directories [/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/workerModule/scoverage/data.dest]
Exception while building coverage report. No source root found for '/Users/cdepaula/repos/riscvassembler/mainargs/src-3/Macros.scala' (source roots: '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.12.17/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.13.9/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/3.2.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.12.17/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.13.9/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/3.2.0/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.12.17/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.13.9/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/3.2.0/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/')
java.lang.RuntimeException: No source root found for '/Users/cdepaula/repos/riscvassembler/mainargs/src-3/Macros.scala' (source roots: '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.12.17/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.13.9/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/3.2.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.12.17/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.13.9/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/3.2.0/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.12.17/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.13.9/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/3.2.0/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/')
	at scoverage.reporter.BaseReportWriter.relativeSource(BaseReportWriter.scala:35)
	at scoverage.reporter.BaseReportWriter.relativeSource(BaseReportWriter.scala:23)
	at scoverage.reporter.ScoverageHtmlWriter.writeFile(ScoverageHtmlWriter.scala:84)
	at scoverage.reporter.ScoverageHtmlWriter.$anonfun$writePackage$1(ScoverageHtmlWriter.scala:79)
	at scoverage.reporter.ScoverageHtmlWriter.$anonfun$writePackage$1$adapted(ScoverageHtmlWriter.scala:79)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at scoverage.reporter.ScoverageHtmlWriter.writePackage(ScoverageHtmlWriter.scala:79)
	at scoverage.reporter.ScoverageHtmlWriter.$anonfun$write$1(ScoverageHtmlWriter.scala:69)
	at scoverage.reporter.ScoverageHtmlWriter.$anonfun$write$1$adapted(ScoverageHtmlWriter.scala:69)
	at scala.collection.immutable.List.foreach(List.scala:333)
	at scoverage.reporter.ScoverageHtmlWriter.write(ScoverageHtmlWriter.scala:69)
	at mill.contrib.scoverage.worker.ScoverageReportWorkerImpl.report(ScoverageReportWorkerImpl.scala:29)
	at mill.contrib.scoverage.ScoverageReport.$anonfun$reportTask$1(ScoverageReport.scala:103)
	at mill.define.Task$TraverseCtx.evaluate(Task.scala:380)
	at mill.eval.Evaluator.$anonfun$evaluateGroup$13(Evaluator.scala:627)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
	at scala.Console$.withErr(Console.scala:193)
	at mill.eval.Evaluator.$anonfun$evaluateGroup$12(Evaluator.scala:627)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
	at scala.Console$.withOut(Console.scala:164)
	at mill.eval.Evaluator.$anonfun$evaluateGroup$11(Evaluator.scala:626)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
	at scala.Console$.withIn(Console.scala:227)
	at mill.eval.Evaluator.$anonfun$evaluateGroup$8(Evaluator.scala:625)
	at mill.eval.Evaluator.$anonfun$evaluateGroup$8$adapted(Evaluator.scala:586)
	at scala.collection.immutable.Vector.foreach(Vector.scala:1856)
	at mill.eval.Evaluator.evaluateGroup(Evaluator.scala:586)
	at mill.eval.Evaluator.$anonfun$evaluateGroupCached$21(Evaluator.scala:478)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:59)
	at mill.eval.Evaluator.evaluateGroupCached(Evaluator.scala:469)
	at mill.eval.Evaluator.$anonfun$sequentialEvaluate$2(Evaluator.scala:202)
	at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:563)
	at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:561)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1293)
	at mill.eval.Evaluator.sequentialEvaluate(Evaluator.scala:177)
	at mill.eval.Evaluator.evaluate(Evaluator.scala:162)
	at mill.main.RunScript$.evaluateNamed(RunScript.scala:363)
	at mill.main.RunScript$.evaluate(RunScript.scala:349)
	at mill.main.RunScript$.$anonfun$evaluateTasks$1(RunScript.scala:314)
	at scala.util.Either.map(Either.scala:382)
	at mill.main.RunScript$.evaluateTasks(RunScript.scala:312)
	at mill.main.RunScript$.$anonfun$runScript$8(RunScript.scala:105)
	at ammonite.util.Res$Success.flatMap(Res.scala:62)
	at mill.main.RunScript$.runScript(RunScript.scala:104)
	at mill.main.MainRunner.$anonfun$runScript$1(MainRunner.scala:119)
	at mill.main.MainRunner.watchLoop2(MainRunner.scala:67)
	at mill.main.MainRunner.runScript(MainRunner.scala:92)
	at mill.MillMain$.main0(MillMain.scala:310)
	at mill.main.MillServerMain$.main0(MillServerMain.scala:79)
	at mill.main.Server.$anonfun$handleRun$1(MillServerMain.scala:184)
	at java.base/java.lang.Thread.run(Thread.java:833)
1 targets failed
linter.htmlReportAll java.lang.RuntimeException: No source root found for '/Users/cdepaula/repos/riscvassembler/mainargs/src-3/Macros.scala' (source roots: '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.12.17/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/2.13.9/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/jvm/3.2.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.12.17/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/2.13.9/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/native/3.2.0/0.4.7/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.12.17/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/2.13.9/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/out/riscvassembler/scalajs/3.2.0/1.11.0/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/test/src/', '/Users/cdepaula/repos/riscvassembler/riscvassembler/src/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/src/', '/Users/cdepaula/repos/riscvassembler/out/rvasmcli/generatedBuildInfo.dest/', '/Users/cdepaula/repos/riscvassembler/rvasmcli/test/src/')
    scoverage.reporter.BaseReportWriter.relativeSource(BaseReportWriter.scala:35)
    scoverage.reporter.BaseReportWriter.relativeSource(BaseReportWriter.scala:23)
    scoverage.reporter.ScoverageHtmlWriter.writeFile(ScoverageHtmlWriter.scala:84)
    scoverage.reporter.ScoverageHtmlWriter.$anonfun$writePackage$1(ScoverageHtmlWriter.scala:79)
    scoverage.reporter.ScoverageHtmlWriter.$anonfun$writePackage$1$adapted(ScoverageHtmlWriter.scala:79)
    scala.collection.immutable.List.foreach(List.scala:333)
    scoverage.reporter.ScoverageHtmlWriter.writePackage(ScoverageHtmlWriter.scala:79)
    scoverage.reporter.ScoverageHtmlWriter.$anonfun$write$1(ScoverageHtmlWriter.scala:69)
    scoverage.reporter.ScoverageHtmlWriter.$anonfun$write$1$adapted(ScoverageHtmlWriter.scala:69)
    scala.collection.immutable.List.foreach(List.scala:333)
    scoverage.reporter.ScoverageHtmlWriter.write(ScoverageHtmlWriter.scala:69)
    mill.contrib.scoverage.worker.ScoverageReportWorkerImpl.report(ScoverageReportWorkerImpl.scala:29)
    mill.contrib.scoverage.ScoverageReport.$anonfun$reportTask$1(ScoverageReport.scala:103)
    mill.define.Task$TraverseCtx.evaluate(Task.scala:380)
❯ mill linter.xmlReportAll
[155/155] linter.xmlReportAll
Processing coverage data for 3 data locations
[info] Found 3 subproject scoverage data directories [/Users/cdepaula/repos/riscvassembler/out/linter/riscvassembler/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/rvasmcli/scoverage/data.dest,/Users/cdepaula/repos/riscvassembler/out/linter/workerModule/scoverage/data.dest]

@lefou
Copy link
Member

lefou commented Sep 29, 2022

@carlosedp This is interesting, because the file Macros.scala doesn't even seem to be part of your project. Maybe, it's a bug in scoverage plugin of Scala 3.2.0?

@lefou
Copy link
Member

lefou commented Sep 29, 2022

Could be, that scoverage detected some inlined macro code and wants to create the Source files listing as HTML.

@ckipp01
Copy link
Contributor Author

ckipp01 commented Sep 29, 2022

Could be, that scoverage detected some inlined macro code and wants to create the Source files listing as HTML.

That could be the case. I've gotten lots of report of this in scoverage and this is reported in Dotty as well scala/scala3#15791.

@lefou
Copy link
Member

lefou commented Sep 29, 2022

On the plus side, this could mean, scoverage is finally recognizing code in macros, which was not the case until now. I use scoverage in most of my Mill plugin projects, and coverage for Mill tasks/targets isn't reported correctly. But "inline" isn't "macro".

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

Successfully merging this pull request may close these issues.

Scoverage support on Scala 3.2
3 participants