File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ test: check_binaries
2727 AIKIDO_LOG_LEVEL=" error" AIKIDO_TOKEN=" token" ./gradlew test
2828
2929cov : check_binaries
30- AIKIDO_LOG_LEVEL=" error" AIKIDO_TOKEN=" token" ./gradlew test --rerun-tasks -PcoverageRun jacocoTestReport
30+ AIKIDO_LOG_LEVEL=" error" AIKIDO_TOKEN=" token" ./gradlew test --rerun-tasks -PcoverageRun jacocoTestReport jacocoTestCoverageVerification
3131
3232
3333# Binaries :
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ plugins {
55}
66
77jacoco {
8- toolVersion " 0.8.12 "
8+ toolVersion " 0.8.15 "
99 reportsDirectory = layout. buildDirectory. dir(' jacoco' )
1010}
1111
@@ -46,7 +46,6 @@ dependencies {
4646test {
4747 jvmArgs ' --add-opens' , ' java.base/java.util=ALL-UNNAMED'
4848 jvmArgs ' --add-opens' , ' java.base/java.lang=ALL-UNNAMED'
49- jvmArgs " -javaagent:${ project.rootDir} /dist/agent.jar=mode=daemon-disabled"
5049 jvmArgs ' -Dnet.bytebuddy.experimental=true' // Mockito support.
5150
5251 systemProperty ' AIK_agent_dir' , " ${ project.rootDir} /dist"
@@ -64,6 +63,12 @@ test {
6463 jacoco {
6564 enabled = true
6665 }
66+ doFirst {
67+ // JaCoCo starts tracking a class when Java loads it.
68+ // Our agent loads agent_api classes, so JaCoCo must start first.
69+ jvmArgs jacoco. getAsJvmArg(), " -javaagent:${ project.rootDir} /dist/agent.jar=mode=daemon-disabled"
70+ jacoco. enabled = false
71+ }
6772}
6873
6974jacocoTestReport {
@@ -75,8 +80,20 @@ jacocoTestReport {
7580 dependsOn test
7681}
7782
83+ jacocoTestCoverageVerification {
84+ violationRules {
85+ rule {
86+ limit {
87+ counter = ' LINE'
88+ minimum = 0.80
89+ }
90+ }
91+ }
92+ dependsOn test
93+ }
94+
7895shadowJar {
7996 mergeServiceFiles()
8097 manifest {
8198 }
82- }
99+ }
You can’t perform that action at this time.
0 commit comments