diff --git a/shield/TESTING.asciidoc b/shield/TESTING.asciidoc index 6e3f659884b..2428d6ff7bc 100644 --- a/shield/TESTING.asciidoc +++ b/shield/TESTING.asciidoc @@ -18,15 +18,14 @@ 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 +The REST tests are run automatically during the integration test phase +(`mvn verify`). 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" +mvn verify --------------------------------------------------------------------------- -`ShieldRestTests` is the executable test class that runs all the +`ShieldRestIT` is the executable test class that runs all the yaml suites available within the `rest-api-spec` folder. diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java deleted file mode 100644 index afe1200ef86..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest0Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 0 */ -public class ShieldRest0Tests extends ShieldRestTestCase { - public ShieldRest0Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(0, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java deleted file mode 100644 index eb30461b6e8..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest1Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 1 */ -public class ShieldRest1Tests extends ShieldRestTestCase { - public ShieldRest1Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(1, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java deleted file mode 100644 index 86b3722d0b6..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest2Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 2 */ -public class ShieldRest2Tests extends ShieldRestTestCase { - public ShieldRest2Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(2, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java deleted file mode 100644 index 9c5c6352b76..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest3Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 3 */ -public class ShieldRest3Tests extends ShieldRestTestCase { - public ShieldRest3Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(3, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java deleted file mode 100644 index a83fc07c128..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest4Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 4 */ -public class ShieldRest4Tests extends ShieldRestTestCase { - public ShieldRest4Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(4, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java deleted file mode 100644 index a30c6955431..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest5Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 5 */ -public class ShieldRest5Tests extends ShieldRestTestCase { - public ShieldRest5Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(5, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java deleted file mode 100644 index eb1e838809f..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest6Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 6 */ -public class ShieldRest6Tests extends ShieldRestTestCase { - public ShieldRest6Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(6, 8); - } -} diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java b/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java deleted file mode 100644 index 8bdc033e9c2..00000000000 --- a/shield/src/test/java/org/elasticsearch/test/ShieldRest7Tests.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License; - * you may not use this file except in compliance with the Elastic License. - */ -package org.elasticsearch.test; - -import com.carrotsearch.randomizedtesting.annotations.Name; -import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.test.rest.ESRestTestCase; -import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.parser.RestTestParseException; - -import java.io.IOException; - -/** Rest API tests subset 7 */ -public class ShieldRest7Tests extends ShieldRestTestCase { - public ShieldRest7Tests(@Name("yaml") RestTestCandidate testCandidate) { - super(testCandidate); - } - - @ParametersFactory - public static Iterable parameters() throws IOException, RestTestParseException { - return ESRestTestCase.createParameters(7, 8); - } -}