-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
Changes from 2 commits
fc7f561
9a71707
82caa2b
d91724b
d82e89d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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.' | ||
|
|
@@ -10,17 +13,24 @@ base { | |
| archivesName = 'x-pack-async-search' | ||
| } | ||
|
|
||
| addQaCheckDependencies(project) | ||
|
|
||
| dependencies { | ||
| compileOnly project(":server") | ||
| testImplementation testArtifact(project(':server')) | ||
|
|
||
| compileOnly project(path: xpackModule('core')) | ||
| testImplementation(testArtifact(project(xpackModule('core')))) | ||
| testImplementation project(path: xpackModule('async')) | ||
| testImplementation testArtifact(project(':server')) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| testImplementation testArtifact(project(xpackModule('core'))) | ||
| testImplementation project(xpackModule('async')) | ||
|
|
||
| internalClusterTestImplementation project(":modules:reindex") | ||
| } | ||
|
|
||
| javaRestTestImplementation testArtifact(project(xpackModule('core'))) | ||
|
|
||
| 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' | ||
| } | ||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ | |
| * 2.0. | ||
| */ | ||
|
|
||
| package org.elasticsearch.qa; | ||
| package org.elasticsearch.xpack.search; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
|
@@ -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(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -95,8 +94,9 @@ public class AsyncSearchSecurityIT extends ESRestTestCase { | |
|
|
||
| @ClassRule | ||
| public static ElasticsearchCluster cluster = ElasticsearchCluster.local() | ||
| .distribution(DistributionType.DEFAULT) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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")) | ||
|
|
||
| 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' | ||
| } |
There was a problem hiding this comment.
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
:qachild project has been removed. This is used to ensure that if I run./gradlew :x-pack:plugin:async-search:checkthat the check tasks for all child projects are also run.