From ce2298c5964e5f4bef8d3a4d6ce0ca4fcb225610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Mon, 17 Dec 2018 16:05:41 +0100 Subject: [PATCH] Use 'node_selector' for type-less yaml-tests in mixed clusters Currently we skip yaml integration tests using the new typless API versions for all clusters where any node has a version earlier than 7.0. This effectively means we don't run this tests in mixed clusters or uphrade scenarios, which is why we also copy each test to a version "*_with_type". The integration test framework seems to have a feature where do-sections can specify that a node it is run agains has a certain version or provides certain features. We can use this "node_selector" feature to make sure we only hit nodes in version >7.0 in the yaml tests that use type-less API calls. This way we don't have to effectively disable mixed version or bwc tests and we might reduce the number of tests we need to copy using the old typed APIs to the bare minimum since we already cover most of the other testing with the new typless versions. This PR shows this with the "_explain" API as an example. --- .../resources/rest-api-spec/test/explain/10_basic.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/10_basic.yml index be40e6357e865..d4cdc952d5dc1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/10_basic.yml @@ -1,7 +1,6 @@ setup: - skip: - version: " - 6.99.99" - reason: types are required in requests before 7.0.0 + features: node_selector - do: indices.create: @@ -25,6 +24,8 @@ setup: "Basic explain": - do: + node_selector: + version: "7.0.0 - " explain: index: test_1 id: id_1 @@ -42,6 +43,8 @@ setup: "Basic explain with alias": - do: + node_selector: + version: "7.0.0 - " explain: index: alias_1 id: id_1 @@ -58,6 +61,8 @@ setup: --- "Explain body without query element": - do: + node_selector: + version: "7.0.0 - " catch: bad_request explain: index: test_1