@@ -10,15 +10,15 @@ plugins {
1010 id ' maven-publish'
1111 id ' antlr'
1212 id ' signing'
13- id " com.gradleup.shadow" version " 9.0.1 "
13+ id " com.gradleup.shadow" version " 8.3.8 "
1414 id " biz.aQute.bnd.builder" version " 6.4.0"
1515 id " io.github.gradle-nexus.publish-plugin" version " 2.0.0"
1616 id " groovy"
1717 id " me.champeau.jmh" version " 0.7.3"
1818 id " net.ltgt.errorprone" version ' 4.3.0'
1919 //
2020 // Kotlin just for tests - not production code
21- id ' org.jetbrains.kotlin.jvm' version ' 2.2.0 '
21+ id ' org.jetbrains.kotlin.jvm' version ' 2.2.21 '
2222}
2323
2424java {
@@ -119,7 +119,7 @@ jar {
119119}
120120
121121dependencies {
122- api ' com.graphql-java:java-dataloader:5.0.2 '
122+ api ' com.graphql-java:java-dataloader:5.0.3 '
123123 api ' org.reactivestreams:reactive-streams:' + reactiveStreamsVersion
124124 api " org.jspecify:jspecify:1.0.0"
125125
@@ -128,19 +128,19 @@ dependencies {
128128
129129 testImplementation group : ' junit' , name : ' junit' , version : ' 4.13.2'
130130 testImplementation ' org.spockframework:spock-core:2.3-groovy-4.0'
131- testImplementation ' net.bytebuddy:byte-buddy:1.17.6 '
131+ testImplementation ' net.bytebuddy:byte-buddy:1.17.8 '
132132 testImplementation ' org.objenesis:objenesis:3.4'
133133 testImplementation ' org.apache.groovy:groovy:4.0.28"'
134134 testImplementation ' org.apache.groovy:groovy-json:4.0.28'
135- testImplementation ' com.google.code.gson:gson:2.13.1 '
136- testImplementation ' org.eclipse.jetty:jetty-server:11.0.25 '
137- testImplementation ' com.fasterxml.jackson.core:jackson-databind:2.19.2 '
135+ testImplementation ' com.google.code.gson:gson:2.13.2 '
136+ testImplementation ' org.eclipse.jetty:jetty-server:11.0.26 '
137+ testImplementation ' com.fasterxml.jackson.core:jackson-databind:2.20.0 '
138138 testImplementation ' org.awaitility:awaitility-groovy:4.3.0'
139139 testImplementation ' com.github.javafaker:javafaker:1.0.2'
140140
141141 testImplementation ' org.reactivestreams:reactive-streams-tck:' + reactiveStreamsVersion
142142 testImplementation " io.reactivex.rxjava2:rxjava:2.2.21"
143- testImplementation " io.projectreactor:reactor-core:3.7.8 "
143+ testImplementation " io.projectreactor:reactor-core:3.7.12 "
144144
145145 testImplementation ' org.testng:testng:7.11.0' // use for reactive streams test inheritance
146146 testImplementation " com.tngtech.archunit:archunit-junit5:1.4.1"
@@ -155,11 +155,11 @@ dependencies {
155155 // comment this in if you want to run JMH benchmarks from idea
156156// jmhAnnotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
157157
158- errorprone ' com.uber.nullaway:nullaway:0.12.8 '
159- errorprone ' com.google.errorprone:error_prone_core:2.41 .0'
158+ errorprone ' com.uber.nullaway:nullaway:0.12.10 '
159+ errorprone ' com.google.errorprone:error_prone_core:2.43 .0'
160160
161161 // just tests - no Kotlin otherwise
162- testCompileOnly ' org.jetbrains.kotlin:kotlin-stdlib-jdk8'
162+ testImplementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8'
163163}
164164
165165shadowJar {
@@ -309,6 +309,10 @@ artifacts {
309309}
310310
311311List<TestDescriptor > failedTests = []
312+ Map<String , Integer > testsAndTime = [:]
313+ Map<String , Integer > testClassesAndTime = [:]
314+ int testCount = 0
315+ long testTime = 0L
312316
313317tasks. withType(Test ) {
314318 useJUnitPlatform()
@@ -322,9 +326,19 @@ tasks.withType(Test) {
322326 dependsOn " jmhClasses"
323327
324328 afterTest { TestDescriptor descriptor , TestResult result ->
329+ testCount++
325330 if (result. getFailedTestCount() > 0 ) {
326331 failedTests. add(descriptor)
327332 }
333+ def ms = (int ) (result. endTime - result. startTime)
334+ testTime + = ms
335+ String className = descriptor. className ?: " unknown"
336+ String name = className + " ." + descriptor. displayName
337+ if (ms > 500 ) {
338+ testsAndTime[name] = ms
339+ testClassesAndTime. compute(className) { k , v -> v == null ? ms : v + ms }
340+ println " \t Test '$name ' took ${ ms} ms"
341+ }
328342 }
329343}
330344
@@ -349,6 +363,10 @@ test.dependsOn testWithJava11
349363 * See https://github.com/gradle/gradle/issues/20151
350364 */
351365gradle. buildFinished {
366+ println " \n\n "
367+ println " ============================"
368+ println " $testCount tests run in $testTime ms"
369+ println " ============================"
352370 if (! failedTests. isEmpty()) {
353371 println " \n\n "
354372 println " ============================"
@@ -359,6 +377,28 @@ gradle.buildFinished {
359377 }
360378 println " ============================"
361379 }
380+ // slowest tests
381+ println " \n\n "
382+ println " ============================"
383+ println " Top 20 slowest test classes"
384+ println " ============================"
385+ showTestResults(testClassesAndTime,20 ) { e ->
386+ println " \t Test class ${ e.key} took ${ e.value} ms"
387+ }
388+ println " \n\n "
389+ println " ============================"
390+ println " Top 50 slowest tests"
391+ println " ============================"
392+ showTestResults(testsAndTime,50 ) { e ->
393+ println " \t Test ${ e.key} took ${ e.value} ms"
394+ }
395+ }
396+
397+ static private showTestResults (Map<String , Integer > testMap , int limit , Closure closure ) {
398+ testMap. entrySet(). stream()
399+ .sorted { e1 , e2 -> e2. getValue() - e1. getValue() }
400+ .limit(limit)
401+ .forEach(closure)
362402}
363403
364404
0 commit comments