File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ plugins {
22 kotlin(" jvm" ) version " 2.0.0"
33 id(" com.diffplug.spotless" ) version " 8.3.0"
44 id(" io.gitlab.arturbosch.detekt" ) version " 1.23.8"
5+ java
6+ jacoco
57}
68
79group = " fair"
@@ -78,9 +80,29 @@ tasks.register<JavaExec>("debugFair") {
7880
7981tasks.test {
8082 useJUnitPlatform()
83+ finalizedBy(tasks.jacocoTestReport) // always generate report after tests
8184 maxHeapSize = " 4g"
8285}
8386
87+ tasks.jacocoTestReport {
88+ dependsOn(tasks.test) // ensure tests run first
89+
90+ reports {
91+ xml.required.set(true ) // for CI tools
92+ html.required.set(true ) // this is the index.html you want
93+ csv.required.set(false )
94+ }
95+ }
96+
97+ tasks.register(" testCoverage" ) {
98+ group = " verification"
99+ description = " Runs tests and generates JaCoCo coverage report"
100+ dependsOn(" test" , " jacocoTestReport" )
101+ doLast {
102+ println (" Check the reports in build/reports/jacoco/test/html/index.html" )
103+ }
104+ }
105+
84106tasks.register<Test >(" debug" ) {
85107 group = " verification"
86108 description = " Run tests and generate IntelliJ debug configs for failing assertions"
You can’t perform that action at this time.
0 commit comments