@@ -26,24 +26,26 @@ test {
2626 useJUnitPlatform()
2727 finalizedBy jacocoTestReport
2828
29- // Enhanced test reporting - focus on failures
29+ // Enhanced test reporting - simple and effective
3030 testLogging {
31+ // Always show these events regardless of log level
3132 events " failed" , " skipped"
3233 exceptionFormat " full"
3334 showCauses true
3435 showExceptions true
3536 showStackTraces true
3637 showStandardStreams = false
3738
38- // Only show details for failed tests
39+ // More details when running with --info
3940 info {
40- events " failed" , " skipped"
41+ events " started " , " passed " , " failed" , " skipped"
4142 exceptionFormat " full"
4243 }
4344
44- // Quiet mode but still show failures
45- quiet {
46- events " failed" , " skipped"
45+ // Debug level for complete output
46+ debug {
47+ events " started" , " passed" , " skipped" , " failed" , " standardOut" , " standardError"
48+ exceptionFormat " full"
4749 }
4850 }
4951
@@ -64,17 +66,34 @@ test {
6466 }
6567 }
6668
69+ // Track test execution (optional - can be removed if too verbose)
70+ beforeTest { desc ->
71+ if (logger. isInfoEnabled()) {
72+ println (" 🧪 Running: ${ desc.className} .${ desc.name} " )
73+ }
74+ }
75+
6776 // Print details for each failed test
6877 afterTest { desc , result ->
6978 if (result. resultType == TestResult.ResultType . FAILURE ) {
70- println (" \n ❌ FAILED: ${ desc.className} .${ desc.name} " )
79+ def border = " =" * 80
80+ println (" \n ${ border} " )
81+ println (" ❌ FAILED TEST: ${ desc.className} .${ desc.name} " )
82+ println (" Duration: ${ result.endTime - result.startTime} ms" )
7183 if (result. exception) {
7284 println (" Exception: ${ result.exception.class.simpleName} " )
7385 println (" Message: ${ result.exception.message} " )
7486 if (result. exception. cause) {
7587 println (" Cause: ${ result.exception.cause.message} " )
7688 }
89+ if (result. exception. stackTrace) {
90+ println (" Stack Trace:" )
91+ result. exception. stackTrace. take(5 ). each { trace ->
92+ println (" at ${ trace} " )
93+ }
94+ }
7795 }
96+ println (" ${ border} " )
7897 }
7998 }
8099}
0 commit comments