Skip to content

Commit d320f36

Browse files
bowenlan-amznmch2
andauthored
Add doc for debugging rest tests (#14491)
* add doc for debugging rest tests Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> * Update TESTING.md Co-authored-by: Marc Handalian <handalm@amazon.com> Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> * Address comment Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> --------- Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com> Co-authored-by: Marc Handalian <handalm@amazon.com>
1 parent badf851 commit d320f36

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)
@@ -272,7 +274,18 @@ yamlRestTest’s and javaRestTest’s are easy to identify, since they are found
272274

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

275-
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).
277+
## Running REST Tests Against An External Cluster
278+
279+
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.
280+
281+
For example :
282+
283+
./gradlew :rest-api-spec:yamlRestTest \
284+
-Dtests.cluster=localhost:9200 -Dtests.rest.cluster=localhost:9200 -Dtests.clustername=opensearch
285+
286+
## Debugging REST Tests
287+
288+
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).
276289

277290
# Testing packaging
278291

0 commit comments

Comments
 (0)