Skip to content

Commit

Permalink
Adding support for integration tests with remote cluster (#111)
Browse files Browse the repository at this point in the history
* Adding 1.3.0 release notes

Signed-off-by: Bharathwaj G <[email protected]>

* Adding support for integration tests with remote cluster

Signed-off-by: Bharathwaj G <[email protected]>

* Readme file changes

Signed-off-by: Bharathwaj G <[email protected]>
  • Loading branch information
bharath-techie authored Mar 16, 2022
1 parent ac7be2f commit 728a3c3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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/"

Expand Down

0 comments on commit 728a3c3

Please sign in to comment.