Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test: check_binaries
AIKIDO_LOG_LEVEL="error" AIKIDO_TOKEN="token" ./gradlew test

cov: check_binaries
AIKIDO_LOG_LEVEL="error" AIKIDO_TOKEN="token" ./gradlew test --rerun-tasks -PcoverageRun jacocoTestReport
AIKIDO_LOG_LEVEL="error" AIKIDO_TOKEN="token" ./gradlew test --rerun-tasks -PcoverageRun jacocoTestReport jacocoTestCoverageVerification


# Binaries :
Expand Down
23 changes: 20 additions & 3 deletions agent_api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

jacoco {
toolVersion "0.8.12"
toolVersion "0.8.15"
reportsDirectory = layout.buildDirectory.dir('jacoco')
}

Expand Down Expand Up @@ -46,7 +46,6 @@ dependencies {
test {
jvmArgs '--add-opens', 'java.base/java.util=ALL-UNNAMED'
jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED'
jvmArgs "-javaagent:${project.rootDir}/dist/agent.jar=mode=daemon-disabled"
jvmArgs '-Dnet.bytebuddy.experimental=true' // Mockito support.

systemProperty 'AIK_agent_dir', "${project.rootDir}/dist"
Expand All @@ -64,6 +63,12 @@ test {
jacoco {
enabled = true
}
doFirst {
// JaCoCo starts tracking a class when Java loads it.
// Our agent loads agent_api classes, so JaCoCo must start first.
jvmArgs jacoco.getAsJvmArg(), "-javaagent:${project.rootDir}/dist/agent.jar=mode=daemon-disabled"
jacoco.enabled = false
}
}

jacocoTestReport {
Expand All @@ -75,8 +80,20 @@ jacocoTestReport {
dependsOn test
}

jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'LINE'
minimum = 0.80
}
}
}
dependsOn test
}

shadowJar {
mergeServiceFiles()
manifest {
}
}
}
Loading