From 02ffd4c5483903d0a91f4196cabd320aebcc71d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Vl=C4=8Dek?= Date: Wed, 16 Mar 2022 18:03:22 +0100 Subject: [PATCH] Rename reference to project OpenSearch was forked from (#2483) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixing log message and renaming internal variable. Improving internal JavaDoc. Signed-off-by: Lukáš Vlček --- .../OpenSearchClientYamlSuiteTestCase.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index ca2659e9523e6..f30b1bfdd1e6b 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -143,10 +143,15 @@ public void initAndResetContext() throws Exception { validateSpec(restSpec); final List hosts = getClusterHosts(); Tuple versionVersionTuple = readVersionsFromCatNodes(adminClient()); - final Version esVersion = versionVersionTuple.v1(); + final Version minVersion = versionVersionTuple.v1(); final Version masterVersion = versionVersionTuple.v2(); - logger.info("initializing client, minimum es version [{}], master version, [{}], hosts {}", esVersion, masterVersion, hosts); - clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, esVersion, masterVersion); + logger.info( + "initializing client, minimum OpenSearch version [{}], master version, [{}], hosts {}", + minVersion, + masterVersion, + hosts + ); + clientYamlTestClient = initClientYamlTestClient(restSpec, client(), hosts, minVersion, masterVersion); restTestExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, randomizeContentType()); adminExecutionContext = new ClientYamlTestExecutionContext(clientYamlTestClient, false); final String[] denylist = resolvePathsProperty(REST_TESTS_BLACKLIST, null); @@ -321,6 +326,13 @@ private static void validateSpec(ClientYamlSuiteRestSpec restSpec) { } } + /** + * Detect minimal node version and master node version of cluster using REST Client. + * + * @param restClient REST client used to discover cluster nodes + * @return {@link Tuple} of [minimal node version, master node version] + * @throws IOException When _cat API output parsing fails + */ private Tuple readVersionsFromCatNodes(RestClient restClient) throws IOException { // we simply go to the _cat/nodes API and parse all versions in the cluster final Request request = new Request("GET", "/_cat/nodes");