From fc488cf3e58b338e62778fde0f030122ee5a9fff Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Fri, 21 Jul 2023 10:26:32 +0800 Subject: [PATCH] fix gradle run (#717) Signed-off-by: Hailong Cui --- notifications/build-tools/merged-coverage.gradle | 3 +++ notifications/build.gradle | 2 +- notifications/core-spi/build.gradle | 2 -- notifications/core/build.gradle | 13 +++++-------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/notifications/build-tools/merged-coverage.gradle b/notifications/build-tools/merged-coverage.gradle index 83fa44d2..03a3b6fc 100644 --- a/notifications/build-tools/merged-coverage.gradle +++ b/notifications/build-tools/merged-coverage.gradle @@ -15,6 +15,9 @@ allprojects { task jacocoReport(type: JacocoReport, group: 'verification') { description = 'Generates an aggregate report from all subprojects' + onlyIf { + gradle.taskGraph.hasTask("jacocoTestReport") + } gradle.projectsEvaluated { subprojects.each { jacocoReport.dependsOn it.tasks.withType(JacocoReport) diff --git a/notifications/build.gradle b/notifications/build.gradle index 26ad6b02..62eac128 100644 --- a/notifications/build.gradle +++ b/notifications/build.gradle @@ -39,7 +39,7 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0" - classpath "org.jacoco:org.jacoco.agent:0.8.5" + classpath "org.jacoco:org.jacoco.agent:0.8.7" } } diff --git a/notifications/core-spi/build.gradle b/notifications/core-spi/build.gradle index 7b70251d..14b9f707 100644 --- a/notifications/core-spi/build.gradle +++ b/notifications/core-spi/build.gradle @@ -20,8 +20,6 @@ repositories { } apply plugin: 'opensearch.java' -apply plugin: 'opensearch.testclusters' -apply plugin: 'opensearch.java-rest-test' apply plugin: 'org.jetbrains.kotlin.jvm' apply plugin: 'org.jetbrains.kotlin.plugin.allopen' diff --git a/notifications/core/build.gradle b/notifications/core/build.gradle index 91df52b1..10abf4a6 100644 --- a/notifications/core/build.gradle +++ b/notifications/core/build.gradle @@ -74,14 +74,6 @@ publishing { } } -tasks.register('integTest', RestIntegTestTask) { - description = "Run tests against a cluster that has security enabled" - testClassesDirs = sourceSets.test.output.classesDirs - classpath = sourceSets.test.runtimeClasspath - systemProperty 'tests.security.manager', 'false' -} - -tasks.named("check").configure { dependsOn(integTest) } check.dependsOn jacocoTestReport // turn off javadoc as it barfs on Kotlin code @@ -107,6 +99,11 @@ test { systemProperty 'tests.security.manager', 'false' } +// disable for core, we don't need to run test cluster +run { + onlyIf { false } +} + //TODO: see if this can be only set at top level and apply to subprojects, or we remove from top project if possible configurations.configureEach { if (it.state != Configuration.State.UNRESOLVED) return