Skip to content

Commit 75f0aa3

Browse files
opensearch-trigger-bot[bot]github-actions[bot]mch2
authored
Add doc for debugging rest tests (opensearch-project#14491) (opensearch-project#14541)
* add doc for debugging rest tests * Update TESTING.md * Address comment --------- (cherry picked from commit d320f36) Signed-off-by: bowenlan-amzn <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Marc Handalian <[email protected]>
1 parent 75d0162 commit 75f0aa3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

TESTING.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ OpenSearch uses [jUnit](https://junit.org/junit5/) for testing, it also uses ran
1717
- [Miscellaneous](#miscellaneous)
1818
- [Running verification tasks](#running-verification-tasks)
1919
- [Testing the REST layer](#testing-the-rest-layer)
20+
- [Running REST Tests Against An External Cluster](#running-rest-tests-against-an-external-cluster)
21+
- [Debugging REST Tests](#debugging-rest-tests)
2022
- [Testing packaging](#testing-packaging)
2123
- [Testing packaging on Windows](#testing-packaging-on-windows)
2224
- [Testing VMs are disposable](#testing-vms-are-disposable)
@@ -271,7 +273,18 @@ yamlRestTest’s and javaRestTest’s are easy to identify, since they are found
271273

272274
If in doubt about which command to use, simply run &lt;gradle path&gt;:check
273275

274-
Note that the REST tests, like all the integration tests, can be run against an external cluster by specifying the `tests.cluster` property, which if present needs to contain a comma separated list of nodes to connect to (e.g. localhost:9300).
276+
## Running REST Tests Against An External Cluster
277+
278+
Note that the REST tests, like all the integration tests, can be run against an external cluster by specifying the following properties `tests.cluster`, `tests.rest.cluster`, `tests.clustername`. Use a comma separated list of node properties for the multi-node cluster.
279+
280+
For example :
281+
282+
./gradlew :rest-api-spec:yamlRestTest \
283+
-Dtests.cluster=localhost:9200 -Dtests.rest.cluster=localhost:9200 -Dtests.clustername=opensearch
284+
285+
## Debugging REST Tests
286+
287+
You can launch a local OpenSearch cluster in debug mode following [Launching and debugging from an IDE](#launching-and-debugging-from-an-ide), and run your REST tests against that following [Running REST Tests Against An External Cluster](#running-rest-tests-against-an-external-cluster).
275288

276289
# Testing packaging
277290

0 commit comments

Comments
 (0)