From ed0f95c0603edbe5bf764467e52cb9876e90d445 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 25 May 2018 16:22:35 +0300 Subject: [PATCH 01/11] remove left-over comment --- qa/smoke-test-rank-eval-with-mustache/build.gradle | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/qa/smoke-test-rank-eval-with-mustache/build.gradle b/qa/smoke-test-rank-eval-with-mustache/build.gradle index 175eb18cff7af..e5dd17ad68387 100644 --- a/qa/smoke-test-rank-eval-with-mustache/build.gradle +++ b/qa/smoke-test-rank-eval-with-mustache/build.gradle @@ -24,10 +24,4 @@ apply plugin: 'elasticsearch.rest-test' dependencies { testCompile project(path: ':modules:rank-eval', configuration: 'runtime') testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') -} - -/* - * One of the integration tests doesn't work with the zip distribution - * and will be fixed later. - * Tracked by https://github.com/elastic/elasticsearch/issues/30628 - */ +} \ No newline at end of file From 677cce544844d3732f2a5031a55043d2473869d8 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 25 May 2018 17:28:38 +0300 Subject: [PATCH 02/11] make sure of the property for plugins --- .../elasticsearch/gradle/plugin/PluginBuildPlugin.groovy | 2 +- .../gradle/test/ClusterFormationTasks.groovy | 3 --- plugins/discovery-file/build.gradle | 2 +- plugins/examples/painless-whitelist/build.gradle | 8 ++++++-- plugins/repository-hdfs/build.gradle | 1 - 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy index 28008f4313c97..c5220b8a8ca93 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy @@ -111,7 +111,7 @@ public class PluginBuildPlugin extends BuildPlugin { private static void createIntegTestTask(Project project) { RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class) integTest.mustRunAfter(project.precommit, project.test) - project.integTestCluster.distribution = 'integ-test-zip' + project.integTestCluster.distribution = System.getProperty('tests.distribution', 'integ-test-zip') project.check.dependsOn(integTest) } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 14aa53e4a1762..2eccfdb81f18a 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -532,9 +532,6 @@ class ClusterFormationTasks { } static Task configureInstallModuleTask(String name, Project project, Task setup, NodeInfo node, Project module) { - if (node.config.distribution != 'integ-test-zip') { - throw new GradleException("Module ${module.path} not allowed be installed distributions other than integ-test-zip because they should already have all modules bundled!") - } if (module.plugins.hasPlugin(PluginBuildPlugin) == false) { throw new GradleException("Task ${name} cannot include module ${module.path} which is not an esplugin") } diff --git a/plugins/discovery-file/build.gradle b/plugins/discovery-file/build.gradle index 529b8cbef304d..e7f2b3442716f 100644 --- a/plugins/discovery-file/build.gradle +++ b/plugins/discovery-file/build.gradle @@ -38,7 +38,7 @@ task setupSeedNodeAndUnicastHostsFile(type: DefaultTask) { // setup the initial cluster with one node that will serve as the seed node // for unicast discovery ClusterConfiguration config = new ClusterConfiguration(project) -config.distribution = 'integ-test-zip' +config.distribution = System.getProperty('tests.distribution', 'integ-test-zip') config.clusterName = 'discovery-file-test-cluster' List nodes = ClusterFormationTasks.setup(project, 'initialCluster', setupSeedNodeAndUnicastHostsFile, config) File srcUnicastHostsFile = file('build/cluster/unicast_hosts.txt') diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index 12bbff8b0419e..dabf64b127c5c 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -30,8 +30,12 @@ dependencies { compileOnly project(':modules:lang-painless') } -integTestCluster { - distribution = 'zip' +if (System.getProperty('tests.distribution') == null) { + integTestCluster.distribution = 'oss-zip' +} + +if (integTestCluster.distribution == 'integ-test-zip') { + integTest.enabled = false } test.enabled = false diff --git a/plugins/repository-hdfs/build.gradle b/plugins/repository-hdfs/build.gradle index 3c94f4ace7759..b9764bed7b3ea 100644 --- a/plugins/repository-hdfs/build.gradle +++ b/plugins/repository-hdfs/build.gradle @@ -153,7 +153,6 @@ for (String fixtureName : ['hdfsFixture', 'haHdfsFixture', 'secureHdfsFixture', project.afterEvaluate { for (String integTestTaskName : ['integTestHa', 'integTestSecure', 'integTestSecureHa']) { ClusterConfiguration cluster = project.extensions.getByName("${integTestTaskName}Cluster") as ClusterConfiguration - cluster.distribution = 'integ-test-zip' cluster.dependsOn(project.bundlePlugin) Task restIntegTestTask = project.tasks.getByName(integTestTaskName) From 73fa278da4ba9994981877363fd6924f7204d47e Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 28 May 2018 12:15:32 +0300 Subject: [PATCH 03/11] skip installing modules if these exist in the distribution --- .../elasticsearch/gradle/test/ClusterFormationTasks.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 2eccfdb81f18a..08e640d31ef4d 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -532,6 +532,10 @@ class ClusterFormationTasks { } static Task configureInstallModuleTask(String name, Project project, Task setup, NodeInfo node, Project module) { + if (node.config.distribution != 'integ-test-zip') { + project.logger.lifecycle("Not installing modules for $name, ${node.config.distribution} already has them") + return setup + } if (module.plugins.hasPlugin(PluginBuildPlugin) == false) { throw new GradleException("Task ${name} cannot include module ${module.path} which is not an esplugin") } From 3364a438418ca9ed31b94bf2cf64d8dbf26ca7a3 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 28 May 2018 13:56:50 +0300 Subject: [PATCH 04/11] Log the distrbution being ran --- .../org/elasticsearch/gradle/test/ClusterFormationTasks.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index 08e640d31ef4d..e7b5e1dc025a1 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -644,6 +644,9 @@ class ClusterFormationTasks { BuildPlugin.requireJavaHome(start, node.javaVersion) } start.doLast(elasticsearchRunner) + start.doFirst { + project.logger.info("Starting node in ${node.clusterName} distribution: ${node.config.distribution}") + } return start } From 9e457bd24c35a0356f92c1121f0a61019e3c5c69 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 28 May 2018 14:05:24 +0300 Subject: [PATCH 05/11] Don't allow running with integ-tests-zip passed externally --- qa/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qa/build.gradle b/qa/build.gradle index 709c309359ecf..b11f3de0a5f8b 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -5,6 +5,9 @@ subprojects { Project subproj -> subproj.tasks.withType(RestIntegTestTask) { subproj.extensions.configure("${it.name}Cluster") { cluster -> cluster.distribution = System.getProperty('tests.distribution', 'oss-zip') + if (cluster.distribution == 'integ-test-zip') { + throw new Exception("tests.distribution=integ.-test-zip is not supported") + } } } } From fef4e226b723dfa69d7ecfbc82cb55c1d96fb38e Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Mon, 28 May 2018 14:05:55 +0300 Subject: [PATCH 06/11] top level x-pack/qa can't run with oss distro --- x-pack/plugin/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 4a0b29c42582a..996cbd27d9028 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -152,3 +152,7 @@ integTestCluster { return tmpFile.exists() } } +if (integTestCluster.distribution.startsWith("oss-") == false) { + integTest.enabled = false +} + From c17a46d112da8e0cdf1563ef94c996fd75150838 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Tue, 29 May 2018 09:10:41 +0300 Subject: [PATCH 07/11] Add support for matching objects in lists Makes it possible to have a key that points to a list and assert that a certain object is present in the list. All keys have to be present and values have to match. The objects in the source list may have additional fields. example: ``` match: { 'nodes.$master.plugins': { name: ingest-attachment } } ``` --- .../rest/yaml/section/MatchAssertion.java | 40 ++++++++++++++++++- .../rest/yaml/section/AssertionTests.java | 16 ++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java index 82d8dbeebe6a1..a12c119ca4a15 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java @@ -26,13 +26,22 @@ import org.elasticsearch.test.NotEqualMessageBuilder; import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import static org.elasticsearch.test.hamcrest.RegexMatcher.matches; +import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; /** * Represents a match assert section: @@ -81,7 +90,36 @@ protected void doAssert(Object actualValue, Object expectedValue) { } } - if (expectedValue.equals(actualValue) == false) { + // add support for matching objects ({a:b}) against list of objects ([ {a:b, c:d} ]) + if(expectedValue instanceof Map && actualValue instanceof List) { + Map expectedMap = (Map) expectedValue; + List actualList = (List) actualValue; + assertTrue( + getField() + " was expected to be a list with Map but it's " + actualValue, + actualList.stream() + .filter((each) -> each instanceof Map) + .findAny() + .isPresent() + ); + + List> actualValues = actualList.stream() + .filter(each -> each instanceof Map) + .map((each -> (Map) each)) + .filter(each -> each.keySet().containsAll(expectedMap.keySet())) + .collect(Collectors.toList()); + assertThat( + getField() + " expected to be a list with at least one object that has keys: " + + expectedMap.keySet() + " but it was " + actualList, + actualValues, + is(not(empty())) + ); + assertTrue( + getField() + " expected to be a list with at least on object that matches " + expectedMap + + " but was " + actualValues, + actualValues.stream() + .anyMatch(each -> each.entrySet().containsAll(expectedMap.entrySet())) + ); + } else if (expectedValue.equals(actualValue) == false) { NotEqualMessageBuilder message = new NotEqualMessageBuilder(); message.compare(getField(), actualValue, expectedValue); throw new AssertionError(getField() + " didn't match expected value:\n" + message); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java index fcef74678359e..59dab177faa75 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java @@ -134,6 +134,22 @@ public void testParseMatchArray() throws Exception { assertThat(strings.get(1).toString(), equalTo("test_percolator_2")); } + @SuppressWarnings("unchecked") + public void testParseMatchArrayObject() throws Exception { + parser = createParser(YamlXContent.yamlXContent, + "{test: { someKey: someValue } }" + ); + + MatchAssertion matchAssertion = MatchAssertion.parse(parser); + assertThat(matchAssertion, notNullValue()); + assertThat(matchAssertion.getField(), equalTo("test")); + assertThat(matchAssertion.getExpectedValue(), instanceOf(Map.class)); + assertThat( + ((Map) matchAssertion.getExpectedValue()).get("someKey"), + equalTo("someValue") + ); + } + @SuppressWarnings("unchecked") public void testParseMatchSourceValues() throws Exception { parser = createParser(YamlXContent.yamlXContent, From ae9d375169b86f4e22b8cdbbc42020f7a2daf038 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Tue, 29 May 2018 13:29:36 +0300 Subject: [PATCH 08/11] Update plugin and module tests to work with other distributions Some of the tests expected that the integration tests will always be ran with the `integ-test-zip` distribution so that there will be no other plugins loaded. With this change, we check for the presence of the plugin without assuming exclusivity. --- .../rest-api-spec/test/stats/10_basic.yml | 2 +- .../test/analysis-common/10_basic.yml | 2 +- .../rest-api-spec/test/ingest/10_basic.yml | 44 +++++++++---------- .../test/lang_expression/10_basic.yml | 2 +- .../test/lang_mustache/10_basic.yml | 2 +- .../rest-api-spec/test/painless/10_basic.yml | 2 +- .../test/repository_url/10_basic.yml | 2 +- .../resources/rest-api-spec/test/10_basic.yml | 2 +- .../test/discovery_azure_classic/10_basic.yml | 2 +- .../test/discovery_ec2/10_basic.yml | 2 +- .../test/discovery_gce/10_basic.yml | 2 +- .../test/painless_whitelist/10_basic.yml | 2 +- .../test/example-rescore/10_basic.yml | 2 +- .../test/script_expert_scoring/10_basic.yml | 2 +- .../test/ingest_attachment/10_basic.yml | 4 +- .../test/ingest_geoip/10_basic.yml | 4 +- .../test/ingest-useragent/10_basic.yml | 4 +- .../test/repository_azure/10_basic.yml | 2 +- .../test/repository_gcs/10_basic.yml | 2 +- .../test/hdfs_repository/10_basic.yml | 2 +- .../test/secure_hdfs_repository/10_basic.yml | 2 +- .../test/repository_s3/10_basic.yml | 2 +- .../rest-api-spec/test/store_smb/10_basic.yml | 2 +- 23 files changed, 47 insertions(+), 47 deletions(-) diff --git a/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml b/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml index 5ca9a323387ec..37aa2a2c1d411 100644 --- a/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml +++ b/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: aggs-matrix-stats } + - match: { nodes.$master.modules: { name: aggs-matrix-stats } } diff --git a/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml b/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml index d27a0861b2e38..88b7189f5643e 100644 --- a/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml +++ b/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml @@ -8,4 +8,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: analysis-common } + - match: { nodes.$master.modules: { name: analysis-common } } diff --git a/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml b/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml index a58c329a7c525..ec4979ffffce1 100644 --- a/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml +++ b/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml @@ -8,25 +8,25 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: ingest-common } - - match: { nodes.$master.ingest.processors.0.type: append } - - match: { nodes.$master.ingest.processors.1.type: convert } - - match: { nodes.$master.ingest.processors.2.type: date } - - match: { nodes.$master.ingest.processors.3.type: date_index_name } - - match: { nodes.$master.ingest.processors.4.type: dot_expander } - - match: { nodes.$master.ingest.processors.5.type: fail } - - match: { nodes.$master.ingest.processors.6.type: foreach } - - match: { nodes.$master.ingest.processors.7.type: grok } - - match: { nodes.$master.ingest.processors.8.type: gsub } - - match: { nodes.$master.ingest.processors.9.type: join } - - match: { nodes.$master.ingest.processors.10.type: json } - - match: { nodes.$master.ingest.processors.11.type: kv } - - match: { nodes.$master.ingest.processors.12.type: lowercase } - - match: { nodes.$master.ingest.processors.13.type: remove } - - match: { nodes.$master.ingest.processors.14.type: rename } - - match: { nodes.$master.ingest.processors.15.type: script } - - match: { nodes.$master.ingest.processors.16.type: set } - - match: { nodes.$master.ingest.processors.17.type: sort } - - match: { nodes.$master.ingest.processors.18.type: split } - - match: { nodes.$master.ingest.processors.19.type: trim } - - match: { nodes.$master.ingest.processors.20.type: uppercase } + - match: { nodes.$master.modules: { name: ingest-common } } + - match: { nodes.$master.ingest.processors: { type: append } } + - match: { nodes.$master.ingest.processors: { type: convert } } + - match: { nodes.$master.ingest.processors: { type: date } } + - match: { nodes.$master.ingest.processors: { type: date_index_name } } + - match: { nodes.$master.ingest.processors: { type: dot_expander } } + - match: { nodes.$master.ingest.processors: { type: fail } } + - match: { nodes.$master.ingest.processors: { type: foreach } } + - match: { nodes.$master.ingest.processors: { type: grok } } + - match: { nodes.$master.ingest.processors: { type: gsub } } + - match: { nodes.$master.ingest.processors: { type: join } } + - match: { nodes.$master.ingest.processors: { type: json } } + - match: { nodes.$master.ingest.processors: { type: kv } } + - match: { nodes.$master.ingest.processors: { type: lowercase } } + - match: { nodes.$master.ingest.processors: { type: remove } } + - match: { nodes.$master.ingest.processors: { type: rename } } + - match: { nodes.$master.ingest.processors: { type: script } } + - match: { nodes.$master.ingest.processors: { type: set } } + - match: { nodes.$master.ingest.processors: { type: sort } } + - match: { nodes.$master.ingest.processors: { type: split } } + - match: { nodes.$master.ingest.processors: { type: trim } } + - match: { nodes.$master.ingest.processors: { type: uppercase } } diff --git a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml index cc777bd826bbc..6f4ea7a9f7722 100644 --- a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml +++ b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: lang-expression } + - match: { nodes.$master.modules: { name: lang-expression } } diff --git a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml index 5deabe038906d..4df597543e421 100644 --- a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml +++ b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: lang-mustache } + - match: { nodes.$master.modules: { name: lang-mustache } } diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml index 1c81782f33a67..2b770b2688e6d 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml +++ b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: lang-painless } + - match: { nodes.$master.modules: { name: lang-painless } } diff --git a/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml b/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml index 7edbc4c08fbf7..c5cfb8a5ebb4c 100644 --- a/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml +++ b/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml @@ -112,7 +112,7 @@ teardown: - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: repository-url } + - match: { nodes.$master.modules: { name: repository-url } } --- "Restore with repository-url using http://": diff --git a/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml b/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml index e74b7f58c7520..65cc8893ebe41 100644 --- a/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml +++ b/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml @@ -10,7 +10,7 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.0.name: transport-netty4 } + - match: { nodes.$master.modules: { name: transport-netty4 } } - do: cluster.stats: {} diff --git a/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml b/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml index ea042d8a52da8..77b1d67ff232d 100644 --- a/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml +++ b/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: discovery-azure-classic } + - match: { nodes.$master.plugins: { name: discovery-azure-classic } } diff --git a/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml index d612c75db979c..647efe7abfb8b 100644 --- a/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml +++ b/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: discovery-ec2 } + - match: { nodes.$master.plugins: { name: discovery-ec2 } } diff --git a/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml index 6f48aa6c29e90..513dad358cdde 100644 --- a/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml +++ b/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: discovery-gce } + - match: { nodes.$master.plugins: { name: discovery-gce } } diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml b/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml index f0abcf117da15..692d7ecb66259 100644 --- a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml +++ b/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: painless-whitelist } + - match: { nodes.$master.plugins: { name: painless-whitelist } } diff --git a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml b/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml index 75c22d6b578bd..91e1b0e824e77 100644 --- a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml +++ b/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: example-rescore } + - match: { nodes.$master.plugins: { name: example-rescore } } diff --git a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml b/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml index b4fafd69dd4ab..dd95c1496595f 100644 --- a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml +++ b/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: script-expert-scoring } + - match: { nodes.$master.plugins: { name: script-expert-scoring } } diff --git a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml b/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml index 88accac7730e7..1e2807e042258 100644 --- a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml +++ b/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml @@ -7,6 +7,6 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: ingest-attachment } - - match: { nodes.$master.ingest.processors.0.type: attachment } + - match: { 'nodes.$master.plugins': { name: ingest-attachment } } + - match: { 'nodes.$master.ingest.processors': { type: attachment } } diff --git a/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml b/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml index 7a06326a86411..de5f75326b575 100644 --- a/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml +++ b/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml @@ -7,5 +7,5 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: ingest-geoip } - - match: { nodes.$master.ingest.processors.0.type: geoip } + - match: { nodes.$master.plugins: { name: ingest-geoip } } + - match: { nodes.$master.ingest.processors: { type: geoip } } diff --git a/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml b/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml index fee3173f39335..55293c432fb03 100644 --- a/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml +++ b/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml @@ -7,5 +7,5 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: ingest-user-agent } - - match: { nodes.$master.ingest.processors.0.type: user_agent } + - match: { nodes.$master.plugins: { name: ingest-user-agent } } + - match: { nodes.$master.ingest.processors: { type: user_agent } } diff --git a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml index 3a754a34a8a14..8baba7ada6bdb 100644 --- a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml +++ b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: repository-azure } + - match: { nodes.$master.plugins: { name: repository-azure } } diff --git a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml index f4259771644b2..03cb0fdf7e23c 100644 --- a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml +++ b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: repository-gcs } + - match: { nodes.$master.plugins: { name: repository-gcs } } diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml index 6fbbfc82e872d..876ffba1840c7 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml @@ -12,7 +12,7 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: repository-hdfs } + - match: { nodes.$master.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml index 6fbbfc82e872d..876ffba1840c7 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml @@ -12,7 +12,7 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: repository-hdfs } + - match: { nodes.$master.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml index 7bb65a508863d..f18789c3f5edc 100644 --- a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml +++ b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: repository-s3 } + - match: { nodes.$master.plugins: { name: repository-s3 } } diff --git a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml b/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml index a210fd4e5970d..cba5eed519b5d 100644 --- a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml +++ b/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins.0.name: store-smb } + - match: { nodes.$master.plugins: { name: store-smb } } From 2b4d2ca0ba2b9c570a60666daaee3be9b3004425 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Wed, 30 May 2018 08:54:09 +0300 Subject: [PATCH 09/11] Allow modules to run on other distros as well To match the behavior of tets.distributions --- .../org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy index c5220b8a8ca93..0a60d6ef87a44 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy @@ -71,7 +71,9 @@ public class PluginBuildPlugin extends BuildPlugin { if (isModule) { project.integTestCluster.module(project) project.tasks.run.clusterConfig.module(project) - project.tasks.run.clusterConfig.distribution = 'integ-test-zip' + project.tasks.run.clusterConfig.distribution = System.getProperty( + 'run.distribution', 'integ-test-zip' + ) } else { project.integTestCluster.plugin(project.path) project.tasks.run.clusterConfig.plugin(project.path) From 86314133b2e4dbe9cf7710ce8dc6d663fc90b609 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Thu, 31 May 2018 10:33:33 +0300 Subject: [PATCH 10/11] Add and use a new `contains` assertion Replaces the previus changes that caused `match` to do a partial match. --- .../rest-api-spec/test/stats/10_basic.yml | 2 +- .../test/analysis-common/10_basic.yml | 2 +- .../rest-api-spec/test/ingest/10_basic.yml | 44 +++++----- .../test/lang_expression/10_basic.yml | 4 +- .../test/lang_mustache/10_basic.yml | 2 +- .../rest-api-spec/test/painless/10_basic.yml | 2 +- .../test/repository_url/10_basic.yml | 2 +- .../resources/rest-api-spec/test/10_basic.yml | 2 +- .../test/discovery_azure_classic/10_basic.yml | 2 +- .../test/discovery_ec2/10_basic.yml | 2 +- .../test/discovery_gce/10_basic.yml | 2 +- .../test/painless_whitelist/10_basic.yml | 2 +- .../test/example-rescore/10_basic.yml | 2 +- .../test/script_expert_scoring/10_basic.yml | 2 +- .../test/ingest_attachment/10_basic.yml | 4 +- .../test/ingest_geoip/10_basic.yml | 4 +- .../test/ingest-useragent/10_basic.yml | 4 +- .../test/repository_azure/10_basic.yml | 2 +- .../test/repository_gcs/10_basic.yml | 2 +- .../test/hdfs_repository/10_basic.yml | 2 +- .../test/secure_hdfs_repository/10_basic.yml | 2 +- .../test/repository_s3/10_basic.yml | 2 +- .../rest-api-spec/test/store_smb/10_basic.yml | 2 +- .../rest/yaml/section/ContainsAssertion.java | 80 +++++++++++++++++++ .../rest/yaml/section/ExecutableSection.java | 1 + .../rest/yaml/section/MatchAssertion.java | 31 +------ .../rest/yaml/section/AssertionTests.java | 14 ++-- .../rest-api-spec/test/xpack/10_basic.yml | 24 +++--- 28 files changed, 149 insertions(+), 97 deletions(-) create mode 100644 test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java diff --git a/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml b/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml index 37aa2a2c1d411..cde34dfa10760 100644 --- a/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml +++ b/modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: aggs-matrix-stats } } + - contains: { nodes.$master.modules: { name: aggs-matrix-stats } } diff --git a/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml b/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml index 88b7189f5643e..b9b905639fd70 100644 --- a/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml +++ b/modules/analysis-common/src/test/resources/rest-api-spec/test/analysis-common/10_basic.yml @@ -8,4 +8,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: analysis-common } } + - contains: { nodes.$master.modules: { name: analysis-common } } diff --git a/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml b/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml index ec4979ffffce1..12efaa9570372 100644 --- a/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml +++ b/modules/ingest-common/src/test/resources/rest-api-spec/test/ingest/10_basic.yml @@ -8,25 +8,25 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: ingest-common } } - - match: { nodes.$master.ingest.processors: { type: append } } - - match: { nodes.$master.ingest.processors: { type: convert } } - - match: { nodes.$master.ingest.processors: { type: date } } - - match: { nodes.$master.ingest.processors: { type: date_index_name } } - - match: { nodes.$master.ingest.processors: { type: dot_expander } } - - match: { nodes.$master.ingest.processors: { type: fail } } - - match: { nodes.$master.ingest.processors: { type: foreach } } - - match: { nodes.$master.ingest.processors: { type: grok } } - - match: { nodes.$master.ingest.processors: { type: gsub } } - - match: { nodes.$master.ingest.processors: { type: join } } - - match: { nodes.$master.ingest.processors: { type: json } } - - match: { nodes.$master.ingest.processors: { type: kv } } - - match: { nodes.$master.ingest.processors: { type: lowercase } } - - match: { nodes.$master.ingest.processors: { type: remove } } - - match: { nodes.$master.ingest.processors: { type: rename } } - - match: { nodes.$master.ingest.processors: { type: script } } - - match: { nodes.$master.ingest.processors: { type: set } } - - match: { nodes.$master.ingest.processors: { type: sort } } - - match: { nodes.$master.ingest.processors: { type: split } } - - match: { nodes.$master.ingest.processors: { type: trim } } - - match: { nodes.$master.ingest.processors: { type: uppercase } } + - contains: { nodes.$master.modules: { name: ingest-common } } + - contains: { nodes.$master.ingest.processors: { type: append } } + - contains: { nodes.$master.ingest.processors: { type: convert } } + - contains: { nodes.$master.ingest.processors: { type: date } } + - contains: { nodes.$master.ingest.processors: { type: date_index_name } } + - contains: { nodes.$master.ingest.processors: { type: dot_expander } } + - contains: { nodes.$master.ingest.processors: { type: fail } } + - contains: { nodes.$master.ingest.processors: { type: foreach } } + - contains: { nodes.$master.ingest.processors: { type: grok } } + - contains: { nodes.$master.ingest.processors: { type: gsub } } + - contains: { nodes.$master.ingest.processors: { type: join } } + - contains: { nodes.$master.ingest.processors: { type: json } } + - contains: { nodes.$master.ingest.processors: { type: kv } } + - contains: { nodes.$master.ingest.processors: { type: lowercase } } + - contains: { nodes.$master.ingest.processors: { type: remove } } + - contains: { nodes.$master.ingest.processors: { type: rename } } + - contains: { nodes.$master.ingest.processors: { type: script } } + - contains: { nodes.$master.ingest.processors: { type: set } } + - contains: { nodes.$master.ingest.processors: { type: sort } } + - contains: { nodes.$master.ingest.processors: { type: split } } + - contains: { nodes.$master.ingest.processors: { type: trim } } + - contains: { nodes.$master.ingest.processors: { type: uppercase } } diff --git a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml index 6f4ea7a9f7722..e98713e553ece 100644 --- a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml +++ b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml @@ -1,4 +1,4 @@ -# Integration tests for Expression scripts +# Integration tests for Expression scriptsmatch # "Expression loaded": - do: @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: lang-expression } } + - contains: { nodes.$master.modules: { name: lang-expression } } diff --git a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml index 4df597543e421..1a014e9cceaa6 100644 --- a/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml +++ b/modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: lang-mustache } } + - contains: { nodes.$master.modules: { name: lang-mustache } } diff --git a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml index 2b770b2688e6d..6d008a484ee3f 100644 --- a/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml +++ b/modules/lang-painless/src/test/resources/rest-api-spec/test/painless/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: lang-painless } } + - contains: { nodes.$master.modules: { name: lang-painless } } diff --git a/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml b/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml index c5cfb8a5ebb4c..2def885234c3e 100644 --- a/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml +++ b/modules/repository-url/src/test/resources/rest-api-spec/test/repository_url/10_basic.yml @@ -112,7 +112,7 @@ teardown: - do: nodes.info: {} - - match: { nodes.$master.modules: { name: repository-url } } + - contains: { nodes.$master.modules: { name: repository-url } } --- "Restore with repository-url using http://": diff --git a/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml b/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml index 65cc8893ebe41..e8b23fa71408b 100644 --- a/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml +++ b/modules/transport-netty4/src/test/resources/rest-api-spec/test/10_basic.yml @@ -10,7 +10,7 @@ - do: nodes.info: {} - - match: { nodes.$master.modules: { name: transport-netty4 } } + - contains: { nodes.$master.modules: { name: transport-netty4 } } - do: cluster.stats: {} diff --git a/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml b/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml index 77b1d67ff232d..6d12da177ea66 100644 --- a/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml +++ b/plugins/discovery-azure-classic/src/test/resources/rest-api-spec/test/discovery_azure_classic/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: discovery-azure-classic } } + - contains: { nodes.$master.plugins: { name: discovery-azure-classic } } diff --git a/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml b/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml index 647efe7abfb8b..3c5866663b94b 100644 --- a/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml +++ b/plugins/discovery-ec2/src/test/resources/rest-api-spec/test/discovery_ec2/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: discovery-ec2 } } + - contains: { nodes.$master.plugins: { name: discovery-ec2 } } diff --git a/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml b/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml index 513dad358cdde..f16599c40fa32 100644 --- a/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml +++ b/plugins/discovery-gce/src/test/resources/rest-api-spec/test/discovery_gce/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: discovery-gce } } + - contains: { nodes.$master.plugins: { name: discovery-gce } } diff --git a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml b/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml index 692d7ecb66259..a915c08067e5c 100644 --- a/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml +++ b/plugins/examples/painless-whitelist/src/test/resources/rest-api-spec/test/painless_whitelist/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: painless-whitelist } } + - contains: { nodes.$master.plugins: { name: painless-whitelist } } diff --git a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml b/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml index 91e1b0e824e77..62a47df9d7869 100644 --- a/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml +++ b/plugins/examples/rescore/src/test/resources/rest-api-spec/test/example-rescore/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: example-rescore } } + - contains: { nodes.$master.plugins: { name: example-rescore } } diff --git a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml b/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml index dd95c1496595f..26980a95b730b 100644 --- a/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml +++ b/plugins/examples/script-expert-scoring/src/test/resources/rest-api-spec/test/script_expert_scoring/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: script-expert-scoring } } + - contains: { nodes.$master.plugins: { name: script-expert-scoring } } diff --git a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml b/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml index 1e2807e042258..42be90f77f944 100644 --- a/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml +++ b/plugins/ingest-attachment/src/test/resources/rest-api-spec/test/ingest_attachment/10_basic.yml @@ -7,6 +7,6 @@ - do: nodes.info: {} - - match: { 'nodes.$master.plugins': { name: ingest-attachment } } - - match: { 'nodes.$master.ingest.processors': { type: attachment } } + - contains: { 'nodes.$master.plugins': { name: ingest-attachment } } + - contains: { 'nodes.$master.ingest.processors': { type: attachment } } diff --git a/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml b/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml index de5f75326b575..413745eab4051 100644 --- a/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml +++ b/plugins/ingest-geoip/src/test/resources/rest-api-spec/test/ingest_geoip/10_basic.yml @@ -7,5 +7,5 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: ingest-geoip } } - - match: { nodes.$master.ingest.processors: { type: geoip } } + - contains: { nodes.$master.plugins: { name: ingest-geoip } } + - contains: { nodes.$master.ingest.processors: { type: geoip } } diff --git a/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml b/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml index 55293c432fb03..4cb1c9b1fba20 100644 --- a/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml +++ b/plugins/ingest-user-agent/src/test/resources/rest-api-spec/test/ingest-useragent/10_basic.yml @@ -7,5 +7,5 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: ingest-user-agent } } - - match: { nodes.$master.ingest.processors: { type: user_agent } } + - contains: { nodes.$master.plugins: { name: ingest-user-agent } } + - contains: { nodes.$master.ingest.processors: { type: user_agent } } diff --git a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml index 8baba7ada6bdb..199d543dda87e 100644 --- a/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml +++ b/plugins/repository-azure/src/test/resources/rest-api-spec/test/repository_azure/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: repository-azure } } + - contains: { nodes.$master.plugins: { name: repository-azure } } diff --git a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml index 03cb0fdf7e23c..5c8fa70bb7a5f 100644 --- a/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml +++ b/plugins/repository-gcs/src/test/resources/rest-api-spec/test/repository_gcs/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: repository-gcs } } + - contains: { nodes.$master.plugins: { name: repository-gcs } } diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml index 876ffba1840c7..f11e0148402cf 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/hdfs_repository/10_basic.yml @@ -12,7 +12,7 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: repository-hdfs } } + - contains: { nodes.$master.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml index 876ffba1840c7..f11e0148402cf 100644 --- a/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml +++ b/plugins/repository-hdfs/src/test/resources/rest-api-spec/test/secure_hdfs_repository/10_basic.yml @@ -12,7 +12,7 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: repository-hdfs } } + - contains: { nodes.$master.plugins: { name: repository-hdfs } } --- # # Check that we can't use file:// repositories or anything like that diff --git a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml index f18789c3f5edc..190a628f0b375 100644 --- a/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml +++ b/plugins/repository-s3/src/test/resources/rest-api-spec/test/repository_s3/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: repository-s3 } } + - contains: { nodes.$master.plugins: { name: repository-s3 } } diff --git a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml b/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml index cba5eed519b5d..60228c1b92356 100644 --- a/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml +++ b/plugins/store-smb/src/test/resources/rest-api-spec/test/store_smb/10_basic.yml @@ -10,4 +10,4 @@ - do: nodes.info: {} - - match: { nodes.$master.plugins: { name: store-smb } } + - contains: { nodes.$master.plugins: { name: store-smb } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java new file mode 100644 index 0000000000000..9d2d91790c7c2 --- /dev/null +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ContainsAssertion.java @@ -0,0 +1,80 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.elasticsearch.test.rest.yaml.section; + +import org.apache.logging.log4j.Logger; +import org.elasticsearch.common.collect.Tuple; +import org.elasticsearch.common.logging.Loggers; +import org.elasticsearch.common.xcontent.XContentLocation; +import org.elasticsearch.common.xcontent.XContentParser; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +public class ContainsAssertion extends Assertion { + public static ContainsAssertion parse(XContentParser parser) throws IOException { + XContentLocation location = parser.getTokenLocation(); + Tuple stringObjectTuple = ParserUtils.parseTuple(parser); + return new ContainsAssertion(location, stringObjectTuple.v1(), stringObjectTuple.v2()); + } + + private static final Logger logger = Loggers.getLogger(ContainsAssertion.class); + + public ContainsAssertion(XContentLocation location, String field, Object expectedValue) { + super(location, field, expectedValue); + } + + @Override + protected void doAssert(Object actualValue, Object expectedValue) { + // add support for matching objects ({a:b}) against list of objects ([ {a:b, c:d} ]) + if(expectedValue instanceof Map && actualValue instanceof List) { + logger.trace("assert that [{}] contains [{}]", actualValue, expectedValue); + Map expectedMap = (Map) expectedValue; + List actualList = (List) actualValue; + List> actualValues = actualList.stream() + .filter(each -> each instanceof Map) + .map((each -> (Map) each)) + .filter(each -> each.keySet().containsAll(expectedMap.keySet())) + .collect(Collectors.toList()); + assertThat( + getField() + " expected to be a list with at least one object that has keys: " + + expectedMap.keySet() + " but it was " + actualList, + actualValues, + is(not(empty())) + ); + assertTrue( + getField() + " expected to be a list with at least on object that matches " + expectedMap + + " but was " + actualValues, + actualValues.stream() + .anyMatch(each -> each.entrySet().containsAll(expectedMap.entrySet())) + ); + } else { + fail("'contains' only supports checking an object against a list of objects"); + } + } +} diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java index ce5ea1c1cde06..ff02d6d16aa4a 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/ExecutableSection.java @@ -47,6 +47,7 @@ public interface ExecutableSection { new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("gte"), GreaterThanEqualToAssertion::parse), new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("lt"), LessThanAssertion::parse), new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("lte"), LessThanOrEqualToAssertion::parse), + new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("contains"), ContainsAssertion::parse), new NamedXContentRegistry.Entry(ExecutableSection.class, new ParseField("length"), LengthAssertion::parse))); /** diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java index a12c119ca4a15..39564bc870659 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java @@ -90,36 +90,7 @@ protected void doAssert(Object actualValue, Object expectedValue) { } } - // add support for matching objects ({a:b}) against list of objects ([ {a:b, c:d} ]) - if(expectedValue instanceof Map && actualValue instanceof List) { - Map expectedMap = (Map) expectedValue; - List actualList = (List) actualValue; - assertTrue( - getField() + " was expected to be a list with Map but it's " + actualValue, - actualList.stream() - .filter((each) -> each instanceof Map) - .findAny() - .isPresent() - ); - - List> actualValues = actualList.stream() - .filter(each -> each instanceof Map) - .map((each -> (Map) each)) - .filter(each -> each.keySet().containsAll(expectedMap.keySet())) - .collect(Collectors.toList()); - assertThat( - getField() + " expected to be a list with at least one object that has keys: " + - expectedMap.keySet() + " but it was " + actualList, - actualValues, - is(not(empty())) - ); - assertTrue( - getField() + " expected to be a list with at least on object that matches " + expectedMap + - " but was " + actualValues, - actualValues.stream() - .anyMatch(each -> each.entrySet().containsAll(expectedMap.entrySet())) - ); - } else if (expectedValue.equals(actualValue) == false) { + if (expectedValue.equals(actualValue) == false) { NotEqualMessageBuilder message = new NotEqualMessageBuilder(); message.compare(getField(), actualValue, expectedValue); throw new AssertionError(getField() + " didn't match expected value:\n" + message); diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java index 59dab177faa75..ddf153ff44f5c 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/yaml/section/AssertionTests.java @@ -135,17 +135,17 @@ public void testParseMatchArray() throws Exception { } @SuppressWarnings("unchecked") - public void testParseMatchArrayObject() throws Exception { + public void testParseContains() throws Exception { parser = createParser(YamlXContent.yamlXContent, - "{test: { someKey: someValue } }" + "{testKey: { someKey: someValue } }" ); - MatchAssertion matchAssertion = MatchAssertion.parse(parser); - assertThat(matchAssertion, notNullValue()); - assertThat(matchAssertion.getField(), equalTo("test")); - assertThat(matchAssertion.getExpectedValue(), instanceOf(Map.class)); + ContainsAssertion containsAssertion = ContainsAssertion.parse(parser); + assertThat(containsAssertion, notNullValue()); + assertThat(containsAssertion.getField(), equalTo("testKey")); + assertThat(containsAssertion.getExpectedValue(), instanceOf(Map.class)); assertThat( - ((Map) matchAssertion.getExpectedValue()).get("someKey"), + ((Map) containsAssertion.getExpectedValue()).get("someKey"), equalTo("someValue") ); } diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml index 8958af0ff4486..789f7a179ff63 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml @@ -1,4 +1,4 @@ -# Integration tests for monitoring +# Integration tests for monitoring.23. # "X-Pack loaded": - do: @@ -10,14 +10,14 @@ - do: nodes.info: {} - - match: { nodes.$master.modules.13.name: x-pack-core } - - match: { nodes.$master.modules.14.name: x-pack-deprecation } - - match: { nodes.$master.modules.15.name: x-pack-graph } - - match: { nodes.$master.modules.16.name: x-pack-logstash } - - match: { nodes.$master.modules.17.name: x-pack-ml } - - match: { nodes.$master.modules.18.name: x-pack-monitoring } - - match: { nodes.$master.modules.19.name: x-pack-rollup } - - match: { nodes.$master.modules.20.name: x-pack-security } - - match: { nodes.$master.modules.21.name: x-pack-sql } - - match: { nodes.$master.modules.22.name: x-pack-upgrade } - - match: { nodes.$master.modules.23.name: x-pack-watcher } + - contains: { nodes.$master.modules: { name: x-pack-core } } + - contains: { nodes.$master.modules: { name: x-pack-deprecation } } + - contains: { nodes.$master.modules: { name: x-pack-graph } } + - contains: { nodes.$master.modules: { name: x-pack-logstash } } + - contains: { nodes.$master.modules: { name: x-pack-ml } } + - contains: { nodes.$master.modules: { name: x-pack-monitoring } } + - contains: { nodes.$master.modules: { name: x-pack-rollup } } + - contains: { nodes.$master.modules: { name: x-pack-security } } + - contains: { nodes.$master.modules: { name: x-pack-sql } } + - contains: { nodes.$master.modules: { name: x-pack-upgrade } } + - contains: { nodes.$master.modules: { name: x-pack-watcher } } From 80ffc3833f070421ea6bb9197f1ba0cd27578da4 Mon Sep 17 00:00:00 2001 From: Alpar Torok Date: Fri, 22 Jun 2018 15:37:06 +0300 Subject: [PATCH 11/11] Implement PR review comments --- .../gradle/test/ClusterFormationTasks.groovy | 3 +++ .../rest-api-spec/test/lang_expression/10_basic.yml | 2 +- plugins/examples/painless-whitelist/build.gradle | 4 ---- qa/build.gradle | 3 --- .../test/rest/yaml/section/MatchAssertion.java | 9 --------- .../test/resources/rest-api-spec/test/xpack/10_basic.yml | 2 +- 6 files changed, 5 insertions(+), 18 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy index e7b5e1dc025a1..336db08a019bb 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy @@ -88,6 +88,9 @@ class ClusterFormationTasks { Configuration currentDistro = project.configurations.create("${prefix}_elasticsearchDistro") Configuration bwcDistro = project.configurations.create("${prefix}_elasticsearchBwcDistro") Configuration bwcPlugins = project.configurations.create("${prefix}_elasticsearchBwcPlugins") + if (System.getProperty('tests.distribution', 'oss-zip') == 'integ-test-zip') { + throw new Exception("tests.distribution=integ-test-zip is not supported") + } configureDistributionDependency(project, config.distribution, currentDistro, VersionProperties.elasticsearch) if (config.numBwcNodes > 0) { if (config.bwcVersion == null) { diff --git a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml index e98713e553ece..0ca21cab93089 100644 --- a/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml +++ b/modules/lang-expression/src/test/resources/rest-api-spec/test/lang_expression/10_basic.yml @@ -1,4 +1,4 @@ -# Integration tests for Expression scriptsmatch +# Integration tests for Expression scripts # "Expression loaded": - do: diff --git a/plugins/examples/painless-whitelist/build.gradle b/plugins/examples/painless-whitelist/build.gradle index dabf64b127c5c..ef1ca7d741e9a 100644 --- a/plugins/examples/painless-whitelist/build.gradle +++ b/plugins/examples/painless-whitelist/build.gradle @@ -34,8 +34,4 @@ if (System.getProperty('tests.distribution') == null) { integTestCluster.distribution = 'oss-zip' } -if (integTestCluster.distribution == 'integ-test-zip') { - integTest.enabled = false -} - test.enabled = false diff --git a/qa/build.gradle b/qa/build.gradle index c0c32cdcf33e5..0336b947d06aa 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -5,9 +5,6 @@ subprojects { Project subproj -> subproj.tasks.withType(RestIntegTestTask) { subproj.extensions.configure("${it.name}Cluster") { cluster -> cluster.distribution = System.getProperty('tests.distribution', 'oss-zip') - if (cluster.distribution == 'integ-test-zip') { - throw new Exception("tests.distribution=integ.-test-zip is not supported") - } if (cluster.distribution == 'zip') { /* * Add Elastic's repositories so we can resolve older versions of the diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java index 39564bc870659..82d8dbeebe6a1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/section/MatchAssertion.java @@ -26,22 +26,13 @@ import org.elasticsearch.test.NotEqualMessageBuilder; import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.Optional; import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.Stream; import static org.elasticsearch.test.hamcrest.RegexMatcher.matches; -import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; -import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; /** * Represents a match assert section: diff --git a/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml b/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml index 789f7a179ff63..1e3fc8407998c 100644 --- a/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml +++ b/x-pack/plugin/src/test/resources/rest-api-spec/test/xpack/10_basic.yml @@ -1,4 +1,4 @@ -# Integration tests for monitoring.23. +# Integration tests for monitoring # "X-Pack loaded": - do: