OpenSearch/TESTING.asciidoc
jaymode 39915f92bc update shield to depend on elasticsearch 2.0
This commit is a squashed commit of work done in conjunction with @rmuir to make
shield work properly with elasticsearch 2.0. This includes ensuring all tests
pass when running with the security manager and updating the code to be compatible
with the latest core forbidden apis.

Shield is now a child project of elasticsearch-parent and inherits a lot of common
build, test, and static coverage functionality from that project resulting in a much
smaller and simpler pom.xml for shield. As part of this work, Shield can now read
rest tests from the elasticsearch jar so the rest tests are run automatically when
running the slow tests.

Original commit: elastic/x-pack-elasticsearch@2ebbf4284a
2015-05-26 13:57:58 -04:00

33 lines
1.3 KiB
Plaintext

[[Testing Framework Cheatsheet]]
= Testing
[partintro]
Elasticsearch and Shield use jUnit for testing, they also use randomness
in the tests, that can be set using a seed, please refer to the
Elasticsearch TESTING.asciidoc cheatsheet to know all about it.
Tests are executed with network transport and unicast discovery, as this is
the configuration that's secured by shield.
== Testing the REST layer
The available integration tests are specific for Shield functionalities
and make use of the java API to communicate with the elasticsearch nodes,
using the internal binary transport (port 9300 by default).
Shield is also tested using the REST tests provided by Elasticsearch core,
just by running those same tests against a cluster with Shield installed.
The REST tests are not run automatically when executing the maven test
command just yet (they are run with the regular suite when -Dtests.slow=true
is supplied). Some tests are blacklisted as they are known to fail against
shield due to different behaviours introduced by the security plugin.
---------------------------------------------------------------------------
mvn test -Dtests.filter="@Rest"
---------------------------------------------------------------------------
`ShieldRestTests` is the executable test class that runs all the
yaml suites available within the `rest-api-spec` folder.