Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into esql_searchstats_for_…
Browse files Browse the repository at this point in the history
…indexed_docvalues
  • Loading branch information
craigtaverner committed Oct 31, 2024
2 parents 856d702 + 6a3a447 commit 02e1d62
Show file tree
Hide file tree
Showing 73 changed files with 412 additions and 512 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ private void registerAndConfigureDistributionArchivesExtension(Project project)
sub.getArtifacts().add(DEFAULT_CONFIGURATION_NAME, distributionArchive.getArchiveTask());
var extractedConfiguration = sub.getConfigurations().create(EXTRACTED_CONFIGURATION_NAME);
extractedConfiguration.setCanBeResolved(false);
extractedConfiguration.setCanBeConsumed(true);
extractedConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
sub.getArtifacts().add(EXTRACTED_CONFIGURATION_NAME, distributionArchive.getExpandedDistTask());
// The "composite" configuration is specifically used for resolving transformed artifacts in an included build
var compositeConfiguration = sub.getConfigurations().create(COMPOSITE_CONFIGURATION_NAME);
compositeConfiguration.setCanBeResolved(false);
compositeConfiguration.setCanBeConsumed(true);
compositeConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
compositeConfiguration.getAttributes().attribute(Attribute.of("composite", Boolean.class), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":plugins:repository-hdfs");
map.put(LegacyRestTestBasePlugin.class, ":plugins:store-smb");
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-rolling-upgrade-remote-cluster");
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-unavailable-clusters");
map.put(LegacyRestTestBasePlugin.class, ":qa:logging-config");
map.put(LegacyRestTestBasePlugin.class, ":qa:mixed-cluster");
map.put(LegacyRestTestBasePlugin.class, ":qa:multi-cluster-search");
map.put(LegacyRestTestBasePlugin.class, ":qa:remote-clusters");
Expand All @@ -65,15 +63,13 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-ingest-with-all-dependencies");
map.put(LegacyRestTestBasePlugin.class, ":qa:smoke-test-plugins");
map.put(LegacyRestTestBasePlugin.class, ":qa:system-indices");
map.put(LegacyRestTestBasePlugin.class, ":qa:unconfigured-node-name");
map.put(LegacyRestTestBasePlugin.class, ":qa:verify-version-constants");
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, ":distribution:archives:integ-test-zip");
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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.elasticsearch.gradle.Version;
import org.elasticsearch.gradle.VersionProperties;
import org.elasticsearch.gradle.distribution.ElasticsearchDistributionTypes;
import org.elasticsearch.gradle.internal.ElasticsearchJavaPlugin;
import org.elasticsearch.gradle.internal.ElasticsearchJavaBasePlugin;
import org.elasticsearch.gradle.internal.InternalDistributionDownloadPlugin;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.test.ErrorReportingTestListener;
Expand Down Expand Up @@ -90,7 +90,7 @@ public RestTestBasePlugin(ProviderFactory providerFactory) {

@Override
public void apply(Project project) {
project.getPluginManager().apply(ElasticsearchJavaPlugin.class);
project.getPluginManager().apply(ElasticsearchJavaBasePlugin.class);
project.getPluginManager().apply(InternalDistributionDownloadPlugin.class);

// Register integ-test and default distributions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public void apply(Project project) {
private void setupDistributionContainer(Project project) {
distributionsContainer = project.container(ElasticsearchDistribution.class, name -> {
var fileConfiguration = project.getConfigurations().create(DISTRO_CONFIG_PREFIX + name);
fileConfiguration.setCanBeConsumed(false);
var extractedConfiguration = project.getConfigurations().create(DISTRO_EXTRACTED_CONFIG_PREFIX + name);
extractedConfiguration.setCanBeConsumed(false);
extractedConfiguration.getAttributes()
.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, ArtifactTypeDefinition.DIRECTORY_TYPE);
var distribution = new ElasticsearchDistribution(
Expand Down
18 changes: 1 addition & 17 deletions distribution/archives/integ-test-zip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.apache.tools.ant.filters.ReplaceTokens

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

// The integ-test-distribution is published to maven
apply plugin: 'elasticsearch.publish'
Expand All @@ -35,19 +35,3 @@ publishing {
}
}
}

tasks.named("javaRestTest").configure {
dependsOn "assemble"
/*
* There are two unique things going on here:
* 1. These tests can be run against an external cluster with
* -Dtests.rest.cluster=whatever and -Dtest.cluster=whatever
* 2. *One* of these tests is incompatible with that and should be skipped
* when running against an external cluster.
*/
if (project.providers.systemProperty("tests.rest.cluster").isPresent()) {
nonInputProperties.systemProperty 'tests.logfile', testClusters.named('javaRestTest').map(c -> c.singleNode().serverLog)
} else {
systemProperty 'tests.logfile', '--external--'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

import java.io.IOException;

Expand All @@ -23,6 +25,14 @@
*/
public class CreatedLocationHeaderIT extends ESRestTestCase {

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

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

public void testCreate() throws IOException {
locationTestCase("PUT", "test/_doc/1");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@
package org.elasticsearch.test.rest;

import org.elasticsearch.common.logging.JsonLogsIntegTestCase;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.LogType;
import org.hamcrest.Matcher;
import org.junit.ClassRule;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.io.InputStream;

import static org.hamcrest.Matchers.is;

public class JsonLogsFormatAndParseIT extends JsonLogsIntegTestCase {

private static final String NODE_NAME = "test-node-0";

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.withNode(localNodeSpecBuilder -> localNodeSpecBuilder.name(NODE_NAME))
.build();

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

@Override
protected Matcher<String> nodeNameMatcher() {
return is("integTest-0");
return is(NODE_NAME);
}

@Override
protected BufferedReader openReader(Path logFile) {
assumeFalse(
"Skipping test because it is being run against an external cluster.",
logFile.getFileName().toString().equals("--external--")
);
return AccessController.doPrivileged((PrivilegedAction<BufferedReader>) () -> {
try {
return Files.newBufferedReader(logFile, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
protected InputStream openLogsStream() {
return cluster.getNodeLog(0, LogType.SERVER_JSON);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.elasticsearch.common.Strings;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

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

public class NodeRestUsageIT extends ESRestTestCase {

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

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

@SuppressWarnings("unchecked")
public void testWithRestUsage() throws IOException {
// First get the current usage figures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@

import org.elasticsearch.client.Request;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.ClassRule;

import java.io.IOException;

import static org.hamcrest.CoreMatchers.containsString;

public class RequestsWithoutContentIT extends ESRestTestCase {

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

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

public void testIndexMissingBody() throws IOException {
ResponseException responseException = expectThrows(
ResponseException.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.ResponseListener;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;

import java.io.IOException;
import java.util.Map;
Expand All @@ -32,6 +34,15 @@
* Tests that wait for refresh is fired if the index is closed.
*/
public class WaitForRefreshAndCloseIT extends ESRestTestCase {

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

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

@Before
public void setupIndex() throws IOException {
Request request = new Request("PUT", "/test");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions docs/reference/landing-page.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
<h3 class="gtk">Get to know Elasticsearch</h3>
<p>
<em>Demos:</em>
<a href="https://www.elastic.co/demo-gallery?solutions=search&features=null&type=hands-on-learning">Hands-on learning for Search</a>
</p>
<p>
<em>New webinar:</em>
<a href="https://www.elastic.co/virtual-events/architecting-search-apps-on-google-cloud">Architect search apps with Google Cloud</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
.build()
)
.setOrigin(INGEST_ORIGIN)
.setVersionMetaKey("version")
.setPrimaryIndex(DATABASES_INDEX)
.setNetNew()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase
.setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED)
.setOrigin(ORIGIN)
.setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN))
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();
static final SystemIndexDescriptor INTERNAL_UNMANAGED = SystemIndexDescriptor.builder()
.setIndexPattern(".int-unman-*")
.setType(SystemIndexDescriptor.Type.INTERNAL_UNMANAGED)
.setOrigin(ORIGIN)
.setAllowedElasticProductOrigins(Collections.emptyList())
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();

Expand All @@ -98,9 +96,7 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase
.setSettings(createSettings(NEEDS_UPGRADE_INDEX_VERSION, INTERNAL_MANAGED_FLAG_VALUE))
.setMappings(createMapping(true, true))
.setOrigin(ORIGIN)
.setVersionMetaKey(VERSION_META_KEY)
.setAllowedElasticProductOrigins(Collections.emptyList())
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();
static final int INTERNAL_UNMANAGED_FLAG_VALUE = 2;
Expand All @@ -113,9 +109,7 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase
.setSettings(createSettings(NEEDS_UPGRADE_INDEX_VERSION, EXTERNAL_MANAGED_FLAG_VALUE))
.setMappings(createMapping(true, false))
.setOrigin(ORIGIN)
.setVersionMetaKey(VERSION_META_KEY)
.setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN))
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();
static final int EXTERNAL_UNMANAGED_FLAG_VALUE = 4;
Expand All @@ -128,7 +122,6 @@ public abstract class AbstractFeatureMigrationIntegTest extends ESIntegTestCase
.setType(SystemIndexDescriptor.Type.EXTERNAL_UNMANAGED)
.setAllowedElasticProductOrigins(Collections.emptyList())
.setAllowedElasticProductOrigins(Collections.singletonList(ORIGIN))
.setMinimumNodeVersion(NEEDS_UPGRADE_VERSION)
.setPriorSystemIndexDescriptors(Collections.emptyList())
.setAllowsTemplates()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package org.elasticsearch.migration;

import org.apache.lucene.util.SetOnce;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusAction;
import org.elasticsearch.action.admin.cluster.migration.GetFeatureUpgradeStatusRequest;
Expand Down Expand Up @@ -268,9 +267,7 @@ public void testMultipleFeatureMigration() throws Exception {
.setSettings(createSettings(IndexVersions.MINIMUM_COMPATIBLE, 0))
.setMappings(createMapping(true, true))
.setOrigin(ORIGIN)
.setVersionMetaKey(VERSION_META_KEY)
.setAllowedElasticProductOrigins(Collections.emptyList())
.setMinimumNodeVersion(Version.CURRENT.minimumCompatibilityVersion())
.setPriorSystemIndexDescriptors(Collections.emptyList())
.build();

Expand Down
9 changes: 3 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
tests:
- class: "org.elasticsearch.upgrades.SearchStatesIT"
issue: "https://github.com/elastic/elasticsearch/issues/108991"
method: "testCanMatch"
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/esql/esql-async-query-api/line_17}
issue: https://github.com/elastic/elasticsearch/issues/109260
Expand Down Expand Up @@ -231,9 +228,6 @@ tests:
- class: org.elasticsearch.xpack.restart.MLModelDeploymentFullClusterRestartIT
method: testDeploymentSurvivesRestart {cluster=UPGRADED}
issue: https://github.com/elastic/elasticsearch/issues/115528
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
method: test {yaml=reference/esql/esql-across-clusters/line_197}
issue: https://github.com/elastic/elasticsearch/issues/115575
- class: org.elasticsearch.oldrepos.OldRepositoryAccessIT
method: testOldRepoAccess
issue: https://github.com/elastic/elasticsearch/issues/115631
Expand Down Expand Up @@ -290,6 +284,9 @@ tests:
- class: org.elasticsearch.index.reindex.ReindexNodeShutdownIT
method: testReindexWithShutdown
issue: https://github.com/elastic/elasticsearch/issues/115996
- class: org.elasticsearch.search.query.SearchQueryIT
method: testAllDocsQueryString
issue: https://github.com/elastic/elasticsearch/issues/115728

# Examples:
#
Expand Down
Loading

0 comments on commit 02e1d62

Please sign in to comment.