diff --git a/README.md b/README.md index f17027f4..ac31a489 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ The project in this package uses the [Gradle](https://docs.gradle.org/current/us 9. `./gradlew asynSearchCluster#rollingUpgradeClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with async search plugin and tests backwards compatibility by performing rolling upgrade of all nodes with the current version of OpenSearch with async search plugin. 10. `./gradlew asynSearchCluster#fullRestartClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with async search plugin and tests backwards compatibility by performing a full restart on the cluster upgrading all the nodes with the current version of OpenSearch with async search plugin. 11. `./gradlew bwcTestSuite -Dtests.security.manager=false` runs all the above bwc tests combined. +12. `./gradlew integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin` launches integration tests against a local cluster and run tests with security When launching a cluster using one of the above commands, logs are placed in `build/testclusters/integTest-0/logs`. Though the logs are teed to the console, in practices it's best to check the actual log file. diff --git a/build.gradle b/build.gradle index 84977bae..06441de7 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ */ import java.util.concurrent.Callable import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask +import org.opensearch.gradle.test.RestIntegTestTask buildscript { ext { distribution = 'oss-zip' @@ -181,6 +182,31 @@ integTest { } } + +task integTestRemote(type: RestIntegTestTask) { + testClassesDirs = sourceSets.test.output.classesDirs + classpath = sourceSets.test.runtimeClasspath + systemProperty 'tests.security.manager', 'false' + systemProperty 'java.io.tmpdir', opensearch_tmp_dir.absolutePath + + systemProperty "https", System.getProperty("https") + systemProperty "user", System.getProperty("user") + systemProperty "password", System.getProperty("password") + + if (System.getProperty("tests.rest.bwcsuite") == null) { + filter { + excludeTestsMatching "org.opensearch.search.asynchronous.bwc.*IT" + } + } + + // Only rest case can run with remote cluster + if (System.getProperty("tests.rest.cluster") != null) { + filter { + includeTestsMatching "org.opensearch.search.asynchronous.rest*" + } + } +} + String baseName = "asynSearchCluster" String bwcFilePath = "src/test/resources/org/opensearch/search/asynchronous/bwc/"