Skip to content

Migrate and consolidate x-pack-async-search REST tests #130832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mark-vieira
Copy link
Contributor

This migrates legacy rest tests in the async-search module, as well as consolidates tests under qa into the main module directory.

@mark-vieira mark-vieira added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label >refactoring auto-backport Automatically create backport pull requests when merged v9.1.0 v9.0.4 v8.19.1 labels Jul 8, 2025
@elasticsearchmachine elasticsearchmachine added v9.2.0 Team:Core/Infra Meta label for core/infra team labels Jul 8, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@@ -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.

@@ -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.

@@ -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.

@@ -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.

compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
testImplementation project(path: xpackModule('async'))
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.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged :Core/Infra/Core Core issues without another label >refactoring Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v8.17.9 v8.18.4 v8.19.1 v9.0.4 v9.1.0 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants