Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
19 changes: 16 additions & 3 deletions x-pack/plugin/async-search/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apply plugin: 'elasticsearch.internal-es-plugin'
apply plugin: 'elasticsearch.internal-cluster-test'
apply plugin: 'elasticsearch.internal-java-rest-test'
apply plugin: 'elasticsearch.internal-yaml-rest-test'

esplugin {
name = 'x-pack-async-search'
description = 'A module which allows to track the progress of a search asynchronously.'
Expand All @@ -10,8 +13,6 @@ base {
archivesName = 'x-pack-async-search'
}

addQaCheckDependencies(project)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer necessary because the :qa child project has been removed. This is used to ensure that if I run ./gradlew :x-pack:plugin:async-search:check that the check tasks for all child projects are also run.


dependencies {
compileOnly project(":server")
testImplementation testArtifact(project(':server'))
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 just tidied these dependency declarations up a bit. I like to group them by source set, so production dependencies, then test, etc.

Expand All @@ -21,6 +22,18 @@ dependencies {
testImplementation project(path: xpackModule('async'))

internalClusterTestImplementation project(":modules:reindex")
}

javaRestTestImplementation(testArtifact(project(xpackModule('core'))))
javaRestTestImplementation project(xpackModule('async-search'))
javaRestTestImplementation project(':test:framework')

clusterModules project(":x-pack:test:deprecated-query")
clusterModules project(':modules:analysis-common')
clusterModules project(':test:external-modules:test-error-query')
}

restResources {
restApi {
include '_common', 'indices', 'index', 'async_search'
}
}
Empty file.
37 changes: 0 additions & 37 deletions x-pack/plugin/async-search/qa/rest/build.gradle

This file was deleted.

11 changes: 0 additions & 11 deletions x-pack/plugin/async-search/qa/security/build.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

package org.elasticsearch.qa;
package org.elasticsearch.xpack.search;
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 went ahead and moved this into the same package as the other test.


import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
Expand All @@ -20,7 +20,7 @@

public class AsyncSearchHeadersIT extends ESRestTestCase {
@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().plugin("x-pack-async-search").build();
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().module("x-pack-async-search").build();
Copy link
Contributor Author

@mark-vieira mark-vieira Jul 8, 2025

Choose a reason for hiding this comment

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

Using a "module" is actually slightly more efficient here as well. Plugins haven't to be built, then packaged into a zip archive. Modules are copied (potentially symlinked) from their original build directory so there's less file IO involved.


@Override
protected String getTestRestCluster() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchResponseUtils;
import org.elasticsearch.test.cluster.ElasticsearchCluster;
import org.elasticsearch.test.cluster.local.distribution.DistributionType;
import org.elasticsearch.test.cluster.util.resource.Resource;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.elasticsearch.xcontent.ConstructingObjectParser;
Expand Down Expand Up @@ -95,8 +94,9 @@ public class AsyncSearchSecurityIT extends ESRestTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed usage of the default distro.

.nodes(2)
.module("test-error-query")
.module("analysis-common")
.module("x-pack-async-search")
.setting("xpack.license.self_generated.type", "trial")
.setting("xpack.security.enabled", "true")
.rolesFile(Resource.fromClasspath("roles.yml"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@

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 AsyncSearchRestIT extends ESClientYamlSuiteTestCase {

@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.module("x-pack-test-deprecated-query")
.module("x-pack-async-search")
.build();

public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) {
super(testCandidate);
}
Expand All @@ -22,4 +30,9 @@ public AsyncSearchRestIT(final ClientYamlTestCandidate testCandidate) {
public static Iterable<Object[]> parameters() throws Exception {
return ESClientYamlSuiteTestCase.createParameters();
}

@Override
protected String getTestRestCluster() {
return cluster.getHttpAddresses();
}
}
14 changes: 14 additions & 0 deletions x-pack/test/deprecated-query/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

apply plugin: 'elasticsearch.base-internal-es-plugin'

esplugin {
name = 'x-pack-test-deprecated-query'
description = 'Deprecated query plugin'
classname ='org.elasticsearch.query.DeprecatedQueryPlugin'
}