From 6f2cbdf0b8cfd166c1ac485cf31a6a38746a7905 Mon Sep 17 00:00:00 2001 From: Nick Knize Date: Wed, 3 Feb 2021 08:29:06 -0600 Subject: [PATCH] [PURIFY] Cleanup build and unblock HLRC integration tests (#33) This commit cleans up the following: * Remove unused imports * Remove ILM settings in hlrc testCluster formation * Comment out security users settings in ElasticsearchNode creation for build-tools tests Signed-off-by: Peter Nied --- ...tributionArchiveCheckPluginFuncTest.groovy | 2 +- .../testclusters/ElasticsearchNode.java | 24 +++++++++---------- client/rest-high-level/build.gradle | 2 -- .../elasticsearch/client/PingAndInfoIT.java | 1 - .../client/RestHighLevelClientTests.java | 1 - .../org/elasticsearch/client/SearchIT.java | 1 - .../core/AcknowledgedResponseTests.java | 1 - .../MetadataDeleteIndexServiceTests.java | 1 - 8 files changed, 13 insertions(+), 20 deletions(-) diff --git a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy index 19647abf997..32b13ab9068 100644 --- a/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy +++ b/buildSrc/src/integTest/groovy/org/elasticsearch/gradle/internal/InternalDistributionArchiveCheckPluginFuncTest.groovy @@ -79,7 +79,7 @@ class InternalDistributionArchiveCheckPluginFuncTest extends AbstractGradleFuncT def "fails on unexpected notice content"() { given: license(file("LICENSE.txt")) - file("NOTICE.txt").text = """OSS Search + file("NOTICE.txt").text = """Elasticsearch Copyright 2009-2018 Acme Coorp""" buildFile << """ apply plugin:'base' diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index 34c4f6d7b67..821eff11b22 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -693,18 +693,18 @@ public class ElasticsearchNode implements TestClusterConfiguration { @Override public void user(Map userSpec) { - Set keys = new HashSet<>(userSpec.keySet()); - keys.remove("username"); - keys.remove("password"); - keys.remove("role"); - if (keys.isEmpty() == false) { - throw new TestClustersException("Unknown keys in user definition " + keys + " for " + this); - } - Map cred = new LinkedHashMap<>(); - cred.put("useradd", userSpec.getOrDefault("username", "test_user")); - cred.put("-p", userSpec.getOrDefault("password", "x-pack-test-password")); - cred.put("-r", userSpec.getOrDefault("role", "superuser")); - credentials.add(cred); + // Set keys = new HashSet<>(userSpec.keySet()); + // keys.remove("username"); + // keys.remove("password"); + // keys.remove("role"); + // if (keys.isEmpty() == false) { + // throw new TestClustersException("Unknown keys in user definition " + keys + " for " + this); + // } + // Map cred = new LinkedHashMap<>(); + // cred.put("useradd", userSpec.getOrDefault("username", "test_user")); + // cred.put("-p", userSpec.getOrDefault("password", "x-pack-test-password")); + // cred.put("-r", userSpec.getOrDefault("role", "superuser")); + // credentials.add(cred); } private void runElasticsearchBinScriptWithInput(String input, String tool, CharSequence... args) { diff --git a/client/rest-high-level/build.gradle b/client/rest-high-level/build.gradle index 4989ed3b690..be31a34bf2d 100644 --- a/client/rest-high-level/build.gradle +++ b/client/rest-high-level/build.gradle @@ -82,8 +82,6 @@ testClusters.all { systemProperty 'es.scripting.update.ctx_in_params', 'false' setting 'reindex.remote.whitelist', '[ "[::1]:*", "127.0.0.1:*" ]' - setting 'indices.lifecycle.poll_interval', '1000ms' - setting 'indices.lifecycle.history_index_enabled', 'false' extraConfigFile 'roles.yml', file('roles.yml') user username: System.getProperty('tests.rest.cluster.username', 'test_user'), password: System.getProperty('tests.rest.cluster.password', 'test-password'), diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/PingAndInfoIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/PingAndInfoIT.java index 9e697317f64..5425a4cf7e5 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/PingAndInfoIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/PingAndInfoIT.java @@ -23,7 +23,6 @@ import org.apache.http.client.methods.HttpGet; import org.elasticsearch.client.core.MainResponse; import java.io.IOException; -import java.util.EnumSet; import java.util.Map; public class PingAndInfoIT extends ESRestHighLevelClientTestCase { diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java index 12eec10d367..8cf60a37e00 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java @@ -99,7 +99,6 @@ import static org.elasticsearch.common.xcontent.XContentHelper.toXContent; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.Matchers.hasItems; import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java index d2e61338a46..ccbde16c90a 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java @@ -43,7 +43,6 @@ import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.common.xcontent.XContentType; -import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilders; diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java index b81f6f11981..91fd92a9e36 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/core/AcknowledgedResponseTests.java @@ -19,7 +19,6 @@ package org.elasticsearch.client.core; import org.elasticsearch.client.AbstractResponseTestCase; -import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; diff --git a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java index bdbc78b4f6f..4d5aeb411b8 100644 --- a/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java +++ b/server/src/test/java/org/elasticsearch/cluster/metadata/MetadataDeleteIndexServiceTests.java @@ -19,7 +19,6 @@ package org.elasticsearch.cluster.metadata; -import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamRequestTests; import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.DataStreamTestHelper;