Skip to content

Commit

Permalink
Add a custom task integTest to trigger integration tests.
Browse files Browse the repository at this point in the history
Signed-off-by: rithin-pullela-aws <[email protected]>
  • Loading branch information
rithin-pullela-aws committed Jan 16, 2025
1 parent 556f834 commit 374bdce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import java.nio.file.Files
import org.opensearch.gradle.test.RestIntegTestTask

buildscript {
ext {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 374bdce

Please sign in to comment.