-
-
Notifications
You must be signed in to change notification settings - Fork 437
Changing testLogLevel for test modules #6972
Description
Mill version: 1.1.5
JVM version: temurin:25
I recently migrated my project to Mill 1.x.x and I noticed that when I run tests there are log messages in this form:
Running Test Class <test class name>
I was looking through the Mill code to see if this can be disabled, and I found out that it's controlled by def testLogLevel: T[TestReporter.LogLevel] = Task(TestReporter.LogLevel.Debug) defined in mill.javalib.TestModule, but I couldn't find any documentation for this property.
I can change it in my tests by importing TestReporter.LogLevel, but it's located in the mill.api.daemon.internal package, and I also need to import mill.javalib.JsonFormatters.logLevelRW because otherwise I get an error that there is no given instance for ReadWriter:
build.mill-68] compile compiling 1 Scala source to out/mill-build/compile.dest/classes ...
build.mill-68] [error] shared/ScalaModule.mill:33:90
build.mill-68] override def testLogLevel = Task(mill.api.daemon.internal.TestReporter.LogLevel.Info)
build.mill-68] ^
build.mill-68] No given instance of type upickle.default.ReadWriter[mill.api.daemon.internal.TestReporter.LogLevel] was found for parameter rw of method apply in object Task.
build.mill-68] I found:
build.mill-68]
build.mill-68] upickle.default.ReadWriter.join[mill.api.daemon.internal.TestReporter.LogLevel](
build.mill-68] upickle.default.superTypeReader[
build.mill-68] mill.api.daemon.internal.TestReporter.LogLevel, V](
build.mill-68] /* missing */
build.mill-68] summon[
build.mill-68] scala.deriving.Mirror.ProductOf[
build.mill-68] mill.api.daemon.internal.TestReporter.LogLevel]
build.mill-68] ]
build.mill-68] ,
build.mill-68] ???, ???, ???),
build.mill-68] ???)
build.mill-68]
build.mill-68] But Failed to synthesize an instance of type scala.deriving.Mirror.ProductOf[mill.api.daemon.internal.TestReporter.LogLevel]: class LogLevel is not a generic product because it is not a case class.
build.mill-68]
build.mill-68] One of the following imports might fix the problem:
build.mill-68]
build.mill-68] import mill.javalib.JsonFormatters.logLevelRW
build.mill-68] import mill.javalib.logLevelRW
build.mill-68] import mill.scalalib.logLevelRW
build.mill-68]
build.mill-68]
build.mill-68]
build.mill-68] [error] one error found
All of this is hinting to me that I should not be changing the testLogLevel in that way. Is there any other way that test log level should be changed, or is it not indented to be changed via build code at all?