Skip to content

Commit 035bd6e

Browse files
authored
Merge pull request #3 from jakelandis/46106-index-deprecation-logs-jake
update gradle config for new testing plugins
2 parents e8429ab + e3c6c82 commit 035bd6e

File tree

7 files changed

+26
-65
lines changed

7 files changed

+26
-65
lines changed
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
import org.elasticsearch.gradle.test.RestIntegTestTask
2-
3-
apply plugin: 'elasticsearch.build'
4-
test.enabled = false
5-
6-
dependencies {
7-
api project(':test:framework')
8-
}
Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import org.elasticsearch.gradle.info.BuildParams
2-
3-
apply plugin: 'elasticsearch.testclusters'
41
apply plugin: 'elasticsearch.esplugin'
5-
apply plugin: 'elasticsearch.rest-resources'
2+
apply plugin: 'elasticsearch.java-rest-test'
63

74
esplugin {
85
description 'Deprecated query plugin'
96
classname 'org.elasticsearch.xpack.deprecation.TestDeprecationPlugin'
107
}
118

129
dependencies {
13-
api("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
14-
api("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
10+
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
11+
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")
12+
// let the javaRestTest see the classpath of main
13+
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
1514
}
1615

1716
restResources {
@@ -20,18 +19,9 @@ restResources {
2019
}
2120
}
2221

23-
testClusters.integTest {
22+
testClusters.all {
2423
testDistribution = 'DEFAULT'
25-
// add the deprecated query plugin
26-
plugin file(project(':x-pack:plugin:deprecation:qa:rest').tasks.bundlePlugin.archiveFile)
2724
setting 'xpack.security.enabled', 'false'
2825
}
2926

3027
test.enabled = false
31-
32-
check.dependsOn integTest
33-
34-
tasks.named("dependencyLicenses").configure {
35-
mapping from: /jackson-.*/, to: 'jackson'
36-
}
37-

x-pack/plugin/deprecation/qa/rest/licenses/jackson-LICENSE

Lines changed: 0 additions & 8 deletions
This file was deleted.

x-pack/plugin/deprecation/qa/rest/licenses/jackson-NOTICE

Lines changed: 0 additions & 20 deletions
This file was deleted.

x-pack/plugin/deprecation/qa/rest/licenses/jackson-annotations-2.10.4.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

x-pack/plugin/deprecation/qa/rest/licenses/jackson-databind-2.10.4.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
import java.util.stream.Collectors;
3636

3737
import static org.elasticsearch.test.hamcrest.RegexMatcher.matches;
38-
import static org.elasticsearch.xpack.deprecation.TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1;
39-
import static org.elasticsearch.xpack.deprecation.TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2;
40-
import static org.elasticsearch.xpack.deprecation.TestDeprecationHeaderRestAction.TEST_NOT_DEPRECATED_SETTING;
4138
import static org.hamcrest.Matchers.containsString;
4239
import static org.hamcrest.Matchers.equalTo;
4340
import static org.hamcrest.Matchers.greaterThan;
@@ -59,10 +56,19 @@ public void testDeprecatedSettingsReturnWarnings() throws IOException {
5956
XContentBuilder builder = JsonXContent.contentBuilder()
6057
.startObject()
6158
.startObject("transient")
62-
.field(TEST_DEPRECATED_SETTING_TRUE1.getKey(), !TEST_DEPRECATED_SETTING_TRUE1.getDefault(Settings.EMPTY))
63-
.field(TEST_DEPRECATED_SETTING_TRUE2.getKey(), !TEST_DEPRECATED_SETTING_TRUE2.getDefault(Settings.EMPTY))
59+
.field(
60+
TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1.getKey(),
61+
!TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1.getDefault(Settings.EMPTY)
62+
)
63+
.field(
64+
TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2.getKey(),
65+
!TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2.getDefault(Settings.EMPTY)
66+
)
6467
// There should be no warning for this field
65-
.field(TEST_NOT_DEPRECATED_SETTING.getKey(), !TEST_NOT_DEPRECATED_SETTING.getDefault(Settings.EMPTY))
68+
.field(
69+
TestDeprecationHeaderRestAction.TEST_NOT_DEPRECATED_SETTING.getKey(),
70+
!TestDeprecationHeaderRestAction.TEST_NOT_DEPRECATED_SETTING.getDefault(Settings.EMPTY)
71+
)
6672
.endObject()
6773
.endObject();
6874

@@ -73,7 +79,10 @@ public void testDeprecatedSettingsReturnWarnings() throws IOException {
7379
final List<String> deprecatedWarnings = getWarningHeaders(response.getHeaders());
7480
final List<Matcher<String>> headerMatchers = new ArrayList<>(2);
7581

76-
for (Setting<Boolean> setting : List.of(TEST_DEPRECATED_SETTING_TRUE1, TEST_DEPRECATED_SETTING_TRUE2)) {
82+
for (Setting<Boolean> setting : List.of(
83+
TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1,
84+
TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2
85+
)) {
7786
headerMatchers.add(
7887
equalTo(
7988
"["
@@ -170,14 +179,14 @@ private void doTestDeprecationWarningsAppearInHeaders() throws IOException {
170179

171180
// deprecated settings should also trigger a deprecation warning
172181
final List<Setting<Boolean>> settings = new ArrayList<>(3);
173-
settings.add(TEST_DEPRECATED_SETTING_TRUE1);
182+
settings.add(TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1);
174183

175184
if (randomBoolean()) {
176-
settings.add(TEST_DEPRECATED_SETTING_TRUE2);
185+
settings.add(TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2);
177186
}
178187

179188
if (useNonDeprecatedSetting) {
180-
settings.add(TEST_NOT_DEPRECATED_SETTING);
189+
settings.add(TestDeprecationHeaderRestAction.TEST_NOT_DEPRECATED_SETTING);
181190
}
182191

183192
Collections.shuffle(settings, random());
@@ -216,7 +225,7 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception {
216225
configureWriteDeprecationLogsToIndex(true);
217226

218227
Request request = new Request("GET", "/_test_cluster/deprecated_settings");
219-
request.setEntity(buildSettingsRequest(List.of(TEST_DEPRECATED_SETTING_TRUE1), true));
228+
request.setEntity(buildSettingsRequest(List.of(TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE1), true));
220229
assertOK(client().performRequest(request));
221230

222231
assertBusy(() -> {

0 commit comments

Comments
 (0)