diff --git a/gradle/plugins/build-parameters/build.gradle.kts b/gradle/plugins/build-parameters/build.gradle.kts index 65d56b270e10..5d647a81a7de 100644 --- a/gradle/plugins/build-parameters/build.gradle.kts +++ b/gradle/plugins/build-parameters/build.gradle.kts @@ -76,6 +76,10 @@ buildParameters { integer("retries") { description = "Configures the number of times failing test are retried" } + bool("hideOpenTestReportHtmlGeneratorOutput") { + description = "Whether or not to hide the output of the OpenTestReportHtmlGenerator" + defaultValue = true + } } group("publishing") { bool("signArtifacts") { diff --git a/gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts b/gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts index 169d5756a10c..f4834d0549aa 100644 --- a/gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts +++ b/gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts @@ -5,6 +5,7 @@ import org.gradle.api.tasks.PathSensitivity.RELATIVE import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED import org.gradle.internal.os.OperatingSystem +import java.io.OutputStream plugins { `java-library` @@ -34,6 +35,13 @@ val generateOpenTestHtmlReport by tasks.registering(JavaExec::class) { }) outputLocation = layout.buildDirectory.file("reports/open-test-report.html") } + if (buildParameters.testing.hideOpenTestReportHtmlGeneratorOutput) { + standardOutput = object : OutputStream() { + override fun write(b: Int) { + // discard output + } + } + } outputs.cacheIf { true } }