diff --git a/TESTING.asciidoc b/TESTING.asciidoc index 9267d29561e..2bea8d4b7db 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -311,20 +311,19 @@ The REST tests are run automatically when executing the "./gradlew check" comman YAML REST tests use the following command (modules and plugins may also include YAML REST tests): --------------------------------------------------------------------------- -./gradlew :rest-api-spec:yamlRestTest +./gradlew :rest-api-spec:yamlRestTest --------------------------------------------------------------------------- A specific test case can be run with the following command: --------------------------------------------------------------------------- -./gradlew ':rest-api-spec:yamlRestTestRunner' \ +./gradlew ':rest-api-spec:yamlRestTest' \ --tests "org.elasticsearch.test.rest.ClientYamlTestSuiteIT" \ - -Dtests.method="test {p0=cat.segments/10_basic/Help}" + -Dtests.method="test {p0=cat.segments/10_basic/Help}" --------------------------------------------------------------------------- -The REST tests support all the options provided by the randomized runner, plus the following: +The YAML REST tests support all the options provided by the randomized runner, plus the following: -* `tests.rest[true|false]`: determines whether the REST tests need to be run (default) or not. * `tests.rest.suite`: comma separated paths of the test suites to be run (by default loaded from /rest-api-spec/test). It is possible to run only a subset of the tests providing a sub-folder or even a single yaml file (the default @@ -334,6 +333,27 @@ e.g. -Dtests.rest.suite=index,get,create/10_with_id blacklisted and need to be skipped e.g. -Dtests.rest.blacklist=index/*/Index document,get/10_basic/* +Java REST tests can be run with the "javaRestTest" task. + +For example : +--------------------------------------------------------------------------- +./gradlew :modules:mapper-extras:javaRestTest +--------------------------------------------------------------------------- + +A specific test case can be run with the following syntax (fqn.test {params}): + +--------------------------------------------------------------------------- +./gradlew ':modules:mapper-extras:javaRestTest' \ + --tests "org.elasticsearch.index.mapper.TokenCountFieldMapperIntegrationIT.testSearchByTokenCount {storeCountedFields=true loadCountedFields=false}" +--------------------------------------------------------------------------- + +yamlRestTest's and javaRestTest's are easy to identify, since they are found in a +respective source directory. However, there are some more specialized REST tests +that use custom task names. These are usually found in "qa" projects commonly +use the "integTest" task. + +If in doubt about which command to use, simply run :check + 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). A transport client will