Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -36,12 +36,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":qa:remote-clusters");
map.put(LegacyRestTestBasePlugin.class, ":qa:repository-multi-version");
map.put(LegacyRestTestBasePlugin.class, ":qa:rolling-upgrade-legacy");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-apm-integration");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-delayed-aggs");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-die-with-dignity");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-error-query");
map.put(LegacyRestTestBasePlugin.class, ":test:external-modules:test-latency-simulating-directory");
map.put(LegacyRestTestBasePlugin.class, ":test:yaml-rest-runner");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:core");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:fleet");
Expand All @@ -60,8 +54,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:smoke-test-plugins-ssl");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:smoke-test-security-with-mustache");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:xpack-prefix-rest-compat");
map.put(LegacyRestTestBasePlugin.class, ":modules:ingest-geoip:qa:file-based-update");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply forgot to remove these in earlier PRs

map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-gce:qa:gce");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:multi-cluster-search-security:legacy-with-basic-license");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:multi-cluster-search-security:legacy-with-full-license");
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:multi-cluster-search-security:legacy-with-restricted-trust");
Expand Down
11 changes: 6 additions & 5 deletions test/external-modules/delayed-aggs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

apply plugin: 'elasticsearch.legacy-yaml-rest-test'

tasks.named('yamlRestTest').configure {
it.onlyIf("snapshot build") { buildParams.snapshotBuild }
}
apply plugin: 'elasticsearch.internal-yaml-rest-test'

esplugin {
description = 'A test module that allows to delay aggregations on shards with a configurable time'
Expand All @@ -23,3 +19,8 @@ restResources {
include '_common', 'indices', 'index', 'cluster', 'search'
}
}

tasks.named('yamlRestTest') {
def isSnapshot = buildParams.snapshotBuild
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@breskeby I had to do this in a number of places, otherwise the configuration cache would throw an error

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Onlyif is evaluated at tasks execution phase and buildparsms here is an extension. Those can not be accessed during execution phase

it.onlyIf("snapshot build") { isSnapshot }
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.ClassRule;

public class DelayedShardAggregationClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("test-delayed-aggs").build();

public DelayedShardAggregationClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand All @@ -24,4 +30,9 @@ public DelayedShardAggregationClientYamlTestSuiteIT(@Name("yaml") ClientYamlTest
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}
}
24 changes: 14 additions & 10 deletions test/external-modules/error-query/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,10 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

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

tasks.named('javaRestTest') {
usesDefaultDistribution("to be triaged")
it.onlyIf("snapshot build") { buildParams.snapshotBuild }
}
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

tasks.named('yamlRestTest').configure {
it.onlyIf("snapshot build") { buildParams.snapshotBuild }
}
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.internal-java-rest-test'

esplugin {
description = 'A test module that exposes a way to simulate search shard failures and warnings'
Expand All @@ -29,3 +22,14 @@ restResources {
include '_common', 'indices', 'index', 'cluster', 'search'
}
}

dependencies {
clusterModules project(':x-pack:plugin:esql')
clusterModules project(':x-pack:plugin:autoscaling')
clusterModules project(':x-pack:plugin:ilm')
}

tasks.withType(StandaloneRestIntegTestTask) {
def isSnapshot = buildParams.snapshotBuild
onlyIf("snapshot build") { isSnapshot }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.junit.ClassRule;

Expand All @@ -35,8 +34,9 @@
public class EsqlPartialResultsIT extends ESRestTestCase {
@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.module("test-error-query")
.module("x-pack-esql")
.module("x-pack-ilm")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esql requires ml which implicitly requires ilm. Perhaps that dependency should be explicit? 🤷

.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.setting("esql.query.allow_partial_results", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;

import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
import org.junit.ClassRule;

public class ErrorQueryClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("test-error-query").build();

public ErrorQueryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand All @@ -24,4 +30,9 @@ public ErrorQueryClientYamlTestSuiteIT(@Name("yaml") ClientYamlTestCandidate tes
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class DefaultLocalClusterHandle implements LocalClusterHandle {
public static final AtomicInteger NEXT_DEBUG_PORT = new AtomicInteger(5007);

private static final Logger LOGGER = LogManager.getLogger(DefaultLocalClusterHandle.class);
private static final Duration CLUSTER_UP_TIMEOUT = Duration.ofMinutes(5);
private static final Duration CLUSTER_UP_TIMEOUT = Duration.ofMinutes(1);

public final ForkJoinPool executor = new ForkJoinPool(
Math.max(Runtime.getRuntime().availableProcessors(), 4),
Expand Down
4 changes: 2 additions & 2 deletions test/yaml-rest-runner/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.legacy-yaml-rest-test'
apply plugin: 'elasticsearch.legacy-yaml-rest-compat-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'
apply plugin: 'elasticsearch.yaml-rest-compat-test'

dependencies {
api project(':test:framework')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@

import org.apache.logging.log4j.Level;
import org.elasticsearch.test.MockLog;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.junit.annotations.TestLogging;
import org.junit.ClassRule;

import java.io.IOException;

public class ESClientYamlSuiteTestCaseFailLogIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();

public ESClientYamlSuiteTestCaseFailLogIT(final ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand Down Expand Up @@ -65,4 +70,9 @@ public void test() throws IOException {
mockLog.assertAllExpectationsMatched();
}
}

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