Skip to content

Commit 49e93c9

Browse files
committed
improves test logging
Signed-off-by: Oleh Dokuka <[email protected]>
1 parent 070cffe commit 49e93c9

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

build.gradle

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 the original author or authors.
2+
* Copyright 2015-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ plugins {
2626
subprojects {
2727
apply plugin: 'io.spring.dependency-management'
2828
apply plugin: 'com.github.sherter.google-java-format'
29-
29+
3030
ext['reactor-bom.version'] = 'Dysprosium-SR6'
3131
ext['logback.version'] = '1.2.3'
3232
ext['findbugs.version'] = '3.0.2'
@@ -109,25 +109,61 @@ subprojects {
109109
}
110110

111111
javadoc {
112+
def jdk = JavaVersion.current().majorVersion
113+
def jdkJavadoc = "https://docs.oracle.com/javase/$jdk/docs/api/"
114+
if (JavaVersion.current().isJava11Compatible()) {
115+
jdkJavadoc = "https://docs.oracle.com/en/java/javase/$jdk/docs/api/"
116+
}
112117
options.with {
113-
links 'https://docs.oracle.com/javase/8/docs/api/'
118+
links jdkJavadoc
114119
links 'https://projectreactor.io/docs/core/release/api/'
115120
links 'https://netty.io/4.1/api/'
116121
}
117122
}
118123

124+
tasks.named("javadoc").configure {
125+
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
126+
}
127+
119128
test {
120129
useJUnitPlatform()
121130

131+
systemProperty "io.netty.leakDetection.level", "ADVANCED"
132+
}
133+
134+
//all test tasks will show FAILED for each test method,
135+
// common exclusions, no scanning
136+
project.tasks.withType(Test).all {
122137
testLogging {
123-
events "started", "passed", "skipped", "failed"
138+
events "FAILED"
139+
showExceptions true
140+
exceptionFormat "FULL"
141+
stackTraceFilters "ENTRY_POINT"
142+
maxGranularity 3
124143
}
125144

126-
systemProperty "io.netty.leakDetection.level", "ADVANCED"
127-
}
145+
if (JavaVersion.current().isJava9Compatible()) {
146+
println "Java 9+: lowering MaxGCPauseMillis to 20ms in ${project.name} ${name}"
147+
jvmArgs = ["-XX:MaxGCPauseMillis=20"]
148+
}
128149

129-
tasks.named("javadoc").configure {
130-
onlyIf { System.getenv('SKIP_RELEASE') != "true" }
150+
systemProperty("java.awt.headless", "true")
151+
systemProperty("reactor.trace.cancel", "true")
152+
systemProperty("reactor.trace.nocapacity", "true")
153+
systemProperty("testGroups", project.properties.get("testGroups"))
154+
scanForTestClasses = false
155+
exclude '**/*Abstract*.*'
156+
157+
//allow re-run of failed tests only without special test tasks failing
158+
// because the filter is too restrictive
159+
filter.setFailOnNoMatchingTests(false)
160+
161+
//display intermediate results for special test tasks
162+
afterSuite { desc, result ->
163+
if (!desc.parent) { // will match the outermost suite
164+
println('\n' + "${desc} Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)")
165+
}
166+
}
131167
}
132168
}
133169

0 commit comments

Comments
 (0)