Test reporter fixes (#1597)

* Fix error message when an invalid test reporter is supplied in Gradle
* Fix Gradle property name in docs
* Fix Gradle property name in tasks
* Introduce `TestReporter.default`, and use it in places where default
is applied
* Remove calls to `convention()`; this is not required because the input
is optional anyways.
This commit is contained in:
Daniel Chao
2026-05-19 11:32:51 -07:00
committed by GitHub
parent 3fbcd463e0
commit e34c3e8c4f
10 changed files with 80 additions and 39 deletions
@@ -22,5 +22,5 @@ class CliTestOptions(
val overwrite: Boolean = false,
val junitAggregateReports: Boolean = false,
val junitAggregateSuiteName: String = "pkl-tests",
val reporter: TestReporter = TestReporter.SPEC,
val reporter: TestReporter = TestReporter.default,
)
@@ -17,5 +17,9 @@ package org.pkl.commons.cli
enum class TestReporter {
SPEC,
MINIMAL,
MINIMAL;
companion object {
@JvmStatic val default: TestReporter = SPEC
}
}
@@ -57,7 +57,7 @@ class TestOptions : OptionGroup() {
option(names = arrayOf("--test-reporter"), help = "Which test reporter to use for CLI output.")
.enum<TestReporter> { it.name.lowercase() }
.single()
.default(TestReporter.SPEC)
.default(TestReporter.default)
val cliTestOptions: CliTestOptions by lazy {
CliTestOptions(