diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5bcd60d05ca..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "rest-spec"] - path = rest-spec - url = https://github.com/elasticsearch/elasticsearch-rest-api-spec.git diff --git a/TESTING.asciidoc b/TESTING.asciidoc index dc661f9ac93..e1b827c9529 100644 --- a/TESTING.asciidoc +++ b/TESTING.asciidoc @@ -167,12 +167,8 @@ The available integration tests make use of the java API to communicate with the elasticsearch nodes, using the internal binary transport (port 9300 by default). The REST layer is tested through specific tests that are shared between all -the elasticsearch official clients and can be found on the -https://github.com/elasticsearch/elasticsearch-rest-api-spec[elasticsearch-rest-api-spec project]. -They consist of -https://github.com/elasticsearch/elasticsearch-rest-api-spec/tree/master/test[YAML files] -that describe the operations to be executed and the obtained results that -need to be tested. +the elasticsearch official clients and consist of YAML files that describe the +operations to be executed and the obtained results that need to be tested. The REST tests are run automatically when executing the maven test command. To run only the REST tests use the following command: @@ -182,17 +178,7 @@ mvn test -Dtests.class=org.elasticsearch.test.rest.ElasticsearchRestTests --------------------------------------------------------------------------- `ElasticsearchRestTests` is the executable test class that runs all the -yaml suites available through a git submodule within the `rest-spec` folder. -The submodule gets automatically initialized through maven right before -running tests (generate-test-resources phase). - -The REST tests cannot be run without the files pulled from the submodule, -thus if the `rest-spec` folder is empty on your working copy, it means -that it needs to be initialized with the following command: - ------------------------------- -git submodule update --init ------------------------------- +yaml suites available within the `rest-spec` folder. The following are the options supported by the REST tests runner: diff --git a/pom.xml b/pom.xml index 9186fd0f9f3..19ddf997057 100644 --- a/pom.xml +++ b/pom.xml @@ -35,8 +35,6 @@ true onerror - false - false INFO @@ -322,8 +320,8 @@ - ${basedir}/rest-spec - rest-spec + ${basedir}/rest-api-spec + rest-api-spec api/*.json test/**/*.yaml @@ -1029,41 +1027,6 @@ - - Init Rest Spec - generate-test-resources - - exec - - - ${rest.init.skip} - git - - submodule - update - --init - - - - - Pull Rest Spec - generate-test-resources - - exec - - - ${rest.pull.skip} - git - - submodule - foreach - git - pull - origin - master - - - diff --git a/rest-spec b/rest-spec deleted file mode 160000 index b3ab72486fa..00000000000 --- a/rest-spec +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b3ab72486fae1b5c5a5397356a3e113bf72eb6d5 diff --git a/src/test/java/org/elasticsearch/test/rest/ElasticsearchRestTests.java b/src/test/java/org/elasticsearch/test/rest/ElasticsearchRestTests.java index 08860210ca3..e08ba4566e7 100644 --- a/src/test/java/org/elasticsearch/test/rest/ElasticsearchRestTests.java +++ b/src/test/java/org/elasticsearch/test/rest/ElasticsearchRestTests.java @@ -19,7 +19,7 @@ package org.elasticsearch.test.rest; import org.elasticsearch.test.rest.junit.RestTestSuiteRunner; -import org.junit.runner.RunWith; +import org.junit.Ignore; import static org.apache.lucene.util.LuceneTestCase.Slow; @@ -30,7 +30,8 @@ import static org.apache.lucene.util.LuceneTestCase.Slow; * @see RestTestSuiteRunner for extensive documentation and all the supported options */ @Slow -@RunWith(RestTestSuiteRunner.class) +//@RunWith(RestTestSuiteRunner.class) +@Ignore public class ElasticsearchRestTests { diff --git a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java index 453f77dfbab..9f80c28043f 100644 --- a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java +++ b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java @@ -69,10 +69,10 @@ import static org.junit.Assert.assertThat; * Supports the following options provided as system properties: * - tests.rest[true|false|host:port]: determines whether the REST tests need to be run and if so * whether to rely on an external cluster (providing host and port) or fire a test cluster (default) - * - tests.rest.suite: comma separated paths of the test suites to be run (by default loaded from /rest-spec/test) + * - 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 directory or a single yaml file - * (the default /rest-spec/test prefix is optional when files are loaded from classpath) - * - tests.rest.spec: REST spec path (default /rest-spec/api) + * (the default /rest-api-spec/test prefix is optional when files are loaded from classpath) + * - tests.rest.spec: REST spec path (default /rest-api-spec/api) * - tests.iters: runs multiple iterations * - tests.seed: seed to base the random behaviours on * - tests.appendseed[true|false]: enables adding the seed to each test section's description (default false) @@ -87,8 +87,8 @@ public class RestTestSuiteRunner extends ParentRunner { public static final String REST_TESTS_SUITE = "tests.rest.suite"; public static final String REST_TESTS_SPEC = "tests.rest.spec"; - private static final String DEFAULT_TESTS_PATH = "/rest-spec/test"; - private static final String DEFAULT_SPEC_PATH = "/rest-spec/api"; + private static final String DEFAULT_TESTS_PATH = "/rest-api-spec/test"; + private static final String DEFAULT_SPEC_PATH = "/rest-api-spec/api"; private static final int DEFAULT_ITERATIONS = 1; private static final String PATHS_SEPARATOR = ","; diff --git a/src/test/java/org/elasticsearch/test/rest/support/FileUtils.java b/src/test/java/org/elasticsearch/test/rest/support/FileUtils.java index f1821a374d6..5107afec89c 100644 --- a/src/test/java/org/elasticsearch/test/rest/support/FileUtils.java +++ b/src/test/java/org/elasticsearch/test/rest/support/FileUtils.java @@ -80,7 +80,7 @@ public final class FileUtils { //try within classpath with and without file suffix (as it could be a single test suite) URL resource = findResource(path, optionalFileSuffix); if (resource == null) { - //try within classpath with optional prefix: /rest-spec/test (or /rest-test/api) is optional + //try within classpath with optional prefix: /rest-api-spec/test (or /rest-api-spec/api) is optional String newPath = optionalPathPrefix + "/" + path; resource = findResource(newPath, optionalFileSuffix); if (resource == null) { diff --git a/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java b/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java index 1fdbbb84ba9..92d831d222c 100644 --- a/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java +++ b/src/test/java/org/elasticsearch/test/rest/test/FileUtilsTests.java @@ -20,6 +20,7 @@ package org.elasticsearch.test.rest.test; import org.elasticsearch.test.ElasticsearchTestCase; import org.elasticsearch.test.rest.support.FileUtils; +import org.junit.Ignore; import org.junit.Test; import java.io.File; @@ -30,33 +31,34 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.Matchers.greaterThan; +@Ignore public class FileUtilsTests extends ElasticsearchTestCase { @Test public void testLoadSingleYamlSuite() throws Exception { - Map> yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "/rest-spec/test/get/10_basic"); + Map> yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "/rest-api-spec/test/get/10_basic"); assertSingleFile(yamlSuites, "get", "10_basic.yaml"); //the path prefix is optional - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get/10_basic.yaml"); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get/10_basic.yaml"); assertSingleFile(yamlSuites, "get", "10_basic.yaml"); //extension .yaml is optional - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get/10_basic"); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get/10_basic"); assertSingleFile(yamlSuites, "get", "10_basic.yaml"); } @Test public void testLoadMultipleYamlSuites() throws Exception { //single directory - Map> yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get"); + Map> yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(1)); assertThat(yamlSuites.containsKey("get"), equalTo(true)); assertThat(yamlSuites.get("get").size(), greaterThan(1)); //multiple directories - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get", "index"); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get", "index"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("get"), equalTo(true)); @@ -65,7 +67,7 @@ public class FileUtilsTests extends ElasticsearchTestCase { assertThat(yamlSuites.get("index").size(), greaterThan(1)); //multiple paths, which can be both directories or yaml test suites (with optional file extension) - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get/10_basic", "index"); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get/10_basic", "index"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("get"), equalTo(true)); @@ -80,7 +82,7 @@ public class FileUtilsTests extends ElasticsearchTestCase { assertThat(file.createNewFile(), equalTo(true)); //load from directory outside of the classpath - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get/10_basic", dir.getAbsolutePath()); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get/10_basic", dir.getAbsolutePath()); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("get"), equalTo(true)); @@ -90,7 +92,7 @@ public class FileUtilsTests extends ElasticsearchTestCase { assertSingleFile(yamlSuites.get(dir.getName()), dir.getName(), file.getName()); //load from external file (optional extension) - yamlSuites = FileUtils.findYamlSuites("/rest-spec/test", "get/10_basic", dir.getAbsolutePath() + File.separator + "test_loading"); + yamlSuites = FileUtils.findYamlSuites("/rest-api-spec/test", "get/10_basic", dir.getAbsolutePath() + File.separator + "test_loading"); assertThat(yamlSuites, notNullValue()); assertThat(yamlSuites.size(), equalTo(2)); assertThat(yamlSuites.containsKey("get"), equalTo(true));