Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:jira");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:pagerduty");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:third-party:slack");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:early-deprecation-rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:deprecation:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:downsample:qa:with-security");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:enrich:qa:rest");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:enrich:qa:rest-with-advanced-security");
Expand Down
24 changes: 11 additions & 13 deletions x-pack/plugin/deprecation/qa/early-deprecation-rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,37 @@
import org.elasticsearch.gradle.util.GradleUtils

apply plugin: 'elasticsearch.base-internal-es-plugin'
apply plugin: 'elasticsearch.legacy-java-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

esplugin {
name = 'deprecation-test-plugin'
description = 'Deprecated query plugin'
classname ='org.elasticsearch.xpack.deprecation.EarlyDeprecationTestPlugin'
classname = 'org.elasticsearch.xpack.deprecation.EarlyDeprecationTestPlugin'
}

dependencies {
javaRestTestImplementation project(path: ':x-pack:plugin:deprecation:qa:common')
compileOnly project(":server")

javaRestTestImplementation project(path: ':x-pack:plugin:deprecation:qa:common')
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")

clusterPlugins project(':x-pack:plugin:deprecation:qa::early-deprecation-rest')
}

// let the javaRestTest see the classpath of main
GradleUtils.extendSourceSet(project, "main", "javaRestTest", tasks.named("javaRestTest"))

tasks.named('javaRestTest') {
usesDefaultDistribution("to be triaged")
}

restResources {
restApi {
include '_common', 'indices', 'index'
}
}

testClusters.configureEach {
testDistribution = 'DEFAULT'
setting 'xpack.security.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
setting 'cluster.deprecation_indexing.enabled', 'true'
setting 'cluster.deprecation_indexing.flush_interval', '1ms'
setting 'logger.org.elasticsearch.xpack.deprecation','TRACE'
setting 'logger.org.elasticsearch.xpack.deprecation.logging','TRACE'
}

// Test clusters run with security disabled
tasks.named("javaRestTest") {
buildParams.withFipsEnabledOnly(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.List;
Expand All @@ -35,6 +38,23 @@
*/
public class EarlyDeprecationIndexingIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.plugin("deprecation-test-plugin")
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("cluster.deprecation_indexing.enabled", "true")
.setting("cluster.deprecation_indexing.flush_interval", "1ms")
.setting("logger.org.elasticsearch.xpack.deprecation", "TRACE")
.setting("logger.org.elasticsearch.xpack.deprecation.logging", "TRACE")
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

/**
* In EarlyDeprecationTestPlugin#onNodeStarted we simulate a very early deprecation that can happen before the template is loaded
* The indexing has to be delayed until templates are loaded.
Expand Down
16 changes: 9 additions & 7 deletions x-pack/plugin/deprecation/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@
import org.elasticsearch.gradle.util.GradleUtils

apply plugin: 'elasticsearch.base-internal-es-plugin'
apply plugin: 'elasticsearch.legacy-java-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

esplugin {
name = 'deprecation-test-plugin'
description = 'Deprecated query plugin'
classname ='org.elasticsearch.xpack.deprecation.TestDeprecationPlugin'
}

dependencies {
compileOnly project(":server")

javaRestTestImplementation project(path: ':x-pack:plugin:deprecation:qa:common')
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
javaRestTestImplementation("com.fasterxml.jackson.core:jackson-databind:${versions.jackson}")

clusterPlugins project(':x-pack:plugin:deprecation:qa:rest')
}

// let the javaRestTest see the classpath of main
Expand All @@ -30,14 +35,11 @@ restResources {
}
}

testClusters.configureEach {
testDistribution = 'DEFAULT'
setting 'cluster.deprecation_indexing.enabled', 'true'
setting 'cluster.deprecation_indexing.flush_interval', '100ms'
setting 'xpack.security.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
tasks.named('javaRestTest') {
usesDefaultDistribution("to be triaged")
}


// Test clusters run with security disabled
tasks.named("javaRestTest") {
buildParams.withFipsEnabledOnly(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.json.JsonXContent;
import org.hamcrest.Matcher;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.rules.TestName;

Expand Down Expand Up @@ -62,6 +65,21 @@
*/
public class DeprecationHttpIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.plugin("deprecation-test-plugin")
.setting("cluster.deprecation_indexing.enabled", "true")
.setting("cluster.deprecation_indexing.flush_interval", "100ms")
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

@Rule
public TestName testName = new TestName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
import org.elasticsearch.client.WarningsHandler;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.search.SearchModule;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xcontent.NamedXContentRegistry;
import org.junit.After;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Collections;
Expand All @@ -28,6 +31,21 @@

public class MlDeprecationIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.plugin("deprecation-test-plugin")
.setting("cluster.deprecation_indexing.enabled", "true")
.setting("cluster.deprecation_indexing.flush_interval", "100ms")
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.build();

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}

private static final RequestOptions REQUEST_OPTIONS = RequestOptions.DEFAULT.toBuilder()
.setWarningsHandler(WarningsHandler.PERMISSIVE)
.build();
Expand Down