From 7aebf2a96b4286822122f3f50bec542215b778f9 Mon Sep 17 00:00:00 2001 From: Jared Burrows Date: Sun, 10 Nov 2024 14:44:48 -0500 Subject: [PATCH] Show test events on CI --- build.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 85c11092..ef020ad4 100644 --- a/build.gradle +++ b/build.gradle @@ -94,17 +94,21 @@ subprojects { } tasks.withType(Test).configureEach { + useJUnitPlatform() // Ensure JUnit Platform is used if you are using JUnit 5 or Spock 2.x + testLogging { exceptionFormat = TestExceptionFormat.FULL showCauses = true showExceptions = true showStackTraces = true - events = [TestLogEvent.FAILED, TestLogEvent.SKIPPED] + + // Check if running on CI and set events accordingly + events = System.getenv("CI") != null ? + TestLogEvent.values() as Set : + [TestLogEvent.FAILED, TestLogEvent.SKIPPED] } def maxWorkerCount = gradle.startParameter.maxWorkerCount maxParallelForks = (maxWorkerCount < 2) ? 1 : maxWorkerCount / 2 - - useJUnitPlatform() // Ensure JUnit Platform is used if you are using JUnit 5 or Spock 2.x } }