Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
fix coverage issue (#134)
Browse files Browse the repository at this point in the history
* fix coverage issue

* revert jni lib change
  • Loading branch information
vamshin authored Jun 9, 2020
1 parent 29f3119 commit 4f360f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 40 deletions.
26 changes: 15 additions & 11 deletions build-tools/knnplugin-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ integTest.runner {
systemProperty 'jacoco.dir', "${jacocoDir}"
}

testClusters.integTest {
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}"
systemProperty 'com.sun.management.jmxremote', "true"
systemProperty 'com.sun.management.jmxremote.authenticate', "false"
systemProperty 'com.sun.management.jmxremote.port', "7777"
systemProperty 'com.sun.management.jmxremote.ssl', "false"
systemProperty 'java.rmi.server.hostname', "127.0.0.1"
}

jacocoTestReport {
dependsOn integTest, test
executionData.from = [dummyTest.jacoco.destinationFile, dummyIntegTest.jacoco.destinationFile]
Expand All @@ -77,6 +68,19 @@ jacocoTestReport {
}
}

project.gradle.projectsEvaluated {
jacocoTestReport.dependsOn integTest.runner

allprojects{
afterEvaluate {
jacocoTestReport.dependsOn integTest.runner

testClusters.integTest {
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}"
systemProperty 'com.sun.management.jmxremote', "true"
systemProperty 'com.sun.management.jmxremote.authenticate', "false"
systemProperty 'com.sun.management.jmxremote.port', "7777"
systemProperty 'com.sun.management.jmxremote.ssl', "false"
systemProperty 'java.rmi.server.hostname', "127.0.0.1"
}
}
}

34 changes: 5 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ plugins {
apply plugin: 'elasticsearch.esplugin'

def usingRemoteCluster = System.properties.containsKey('tests.rest.cluster') || System.properties.containsKey('tests.cluster')
def usingMultiNode = project.properties.containsKey('numNodes')
// Only apply jacoco test coverage if we are running a local single node cluster
def integTestDependOnJniLib = false
if (!usingRemoteCluster) {
integTestDependOnJniLib = true
if (!usingMultiNode) {
apply from: 'build-tools/knnplugin-coverage.gradle'
}
}

ext {
Expand All @@ -74,35 +79,6 @@ jacoco {
toolVersion = "0.8.5"
}

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it)
}))
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}

}
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it)
}))
}
}
check.dependsOn jacocoTestCoverageVerification

check.dependsOn jacocoTestReport

esplugin {
Expand Down

0 comments on commit 4f360f2

Please sign in to comment.