diff --git a/build.gradle b/build.gradle index 3e6fce5..72a13f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ import java.nio.file.Files +import org.opensearch.gradle.test.RestIntegTestTask buildscript { ext { @@ -173,6 +174,19 @@ validateNebulaPom.enabled = false // https://github.com/elastic/opensearch/issues/65247 loggerUsageCheck.enabled = false +// Custom task for running integration tests +task integTest(type: RestIntegTestTask) { + description = "Run integration tests from src/javaRestTest" + // Specify the classpath for integration tests + testClassesDirs = sourceSets.javaRestTest.output.classesDirs + classpath = sourceSets.javaRestTest.runtimeClasspath +} + +testClusters.integTest { + // adds LTR as a plugin to the OS build + plugin(project.tasks.bundlePlugin.archiveFile) +} + tasks.withType(Test).configureEach { task -> if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0 && JavaVersion.current().compareTo(JavaVersion.VERSION_21) < 0) { def policyFile = file("${projectDir}/src/main/plugin-metadata/plugin-security.policy").absolutePath