Skip to content

Commit 1367bd0

Browse files
authored
Remove integTest task from PluginBuildPlugin (#61879)
This commit removes `integTest` task from all es-plugins. Most relevant projects have been converted to use yamlRestTest, javaRestTest, or internalClusterTest in prior PRs. A few projects needed to be adjusted to allow complete removal of this task * x-pack/plugin - converted to use yamlRestTest and javaRestTest * plugins/repository-hdfs - kept the integTest task, but use `rest-test` plugin to define the task * qa/die-with-dignity - convert to javaRestTest * x-pack/qa/security-example-spi-extension - convert to javaRestTest * multiple projects - remove the integTest.enabled = false (yay!) related: #61802 related: #60630 related: #59444 related: #59089 related: #56841 related: #59939 related: #55896
1 parent 0684ebc commit 1367bd0

File tree

52 files changed

+58
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+58
-190
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import org.elasticsearch.gradle.Version
2525
import org.elasticsearch.gradle.VersionProperties
2626
import org.elasticsearch.gradle.dependencies.CompileOnlyResolvePlugin
2727
import org.elasticsearch.gradle.info.BuildParams
28-
import org.elasticsearch.gradle.test.RestIntegTestTask
2928
import org.elasticsearch.gradle.test.RestTestBasePlugin
3029
import org.elasticsearch.gradle.testclusters.RunTask
3130
import org.elasticsearch.gradle.util.Util
@@ -60,16 +59,7 @@ class PluginBuildPlugin implements Plugin<Project> {
6059
boolean isXPackModule = project.path.startsWith(':x-pack:plugin')
6160
boolean isModule = project.path.startsWith(':modules:') || isXPackModule
6261

63-
createIntegTestTask(project)
6462
createBundleTasks(project, extension)
65-
project.tasks.named("integTest").configure {
66-
it.dependsOn(project.tasks.named("bundlePlugin"))
67-
}
68-
if (isModule) {
69-
project.testClusters.integTest.module(project.tasks.bundlePlugin.archiveFile)
70-
} else {
71-
project.testClusters.integTest.plugin(project.tasks.bundlePlugin.archiveFile)
72-
}
7363

7464
project.afterEvaluate {
7565
project.extensions.getByType(PluginPropertiesExtension).extendedPlugins.each { pluginName ->
@@ -116,14 +106,6 @@ class PluginBuildPlugin implements Plugin<Project> {
116106
}
117107
}
118108

119-
//disable integTest task if project has been converted to use yaml or java rest test plugin
120-
project.pluginManager.withPlugin("elasticsearch.yaml-rest-test") {
121-
project.tasks.integTest.enabled = false
122-
}
123-
project.pluginManager.withPlugin("elasticsearch.java-rest-test") {
124-
project.tasks.integTest.enabled = false
125-
}
126-
127109
project.tasks.named('testingConventions').configure {
128110
naming.clear()
129111
naming {
@@ -142,7 +124,6 @@ class PluginBuildPlugin implements Plugin<Project> {
142124
// allow running ES with this plugin in the foreground of a build
143125
project.tasks.register('run', RunTask) {
144126
dependsOn(project.tasks.bundlePlugin)
145-
useCluster project.testClusters.integTest
146127
}
147128
}
148129

@@ -172,13 +153,6 @@ class PluginBuildPlugin implements Plugin<Project> {
172153
}
173154
}
174155

175-
/** Adds an integTest task which runs rest tests */
176-
private static void createIntegTestTask(Project project) {
177-
RestIntegTestTask integTest = project.tasks.create('integTest', RestIntegTestTask.class)
178-
integTest.mustRunAfter('precommit', 'test')
179-
project.check.dependsOn(integTest)
180-
}
181-
182156
/**
183157
* Adds a bundlePlugin task which builds the zip containing the plugin jars,
184158
* metadata, properties, and packaging files

buildSrc/src/test/java/org/elasticsearch/gradle/plugin/PluginBuildPluginTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void testApply() {
5050
);
5151
assertNotNull("plugin extensions has the right type", project.getExtensions().findByType(PluginPropertiesExtension.class));
5252

53-
assertNotNull("plugin created an integTest class", project.getTasks().findByName("integTest"));
53+
assertNull("plugin should not create the integTest task", project.getTasks().findByName("integTest"));
5454
}
5555

5656
@Ignore("https://github.com/elastic/elasticsearch/issues/47123")

client/client-benchmark-noop-api-plugin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ dependenciesInfo.enabled = false
3535

3636
// no unit tests
3737
test.enabled = false
38-
integTest.enabled = false

distribution/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each {
253253
copyLog4jProperties(buildOssLog4jConfig, module)
254254
copyLog4jProperties(buildDefaultLog4jConfig, module)
255255

256-
// make sure the module's integration tests run after the integ-test-zip (ie rest tests)
257-
module.afterEvaluate({
258-
module.integTest.mustRunAfter(':distribution:archives:integ-test-zip:integTest')
259-
})
260256
restTestExpansions['expected.modules.count'] += 1
261257
}
262258

modules/lang-expression/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ restResources {
3737
}
3838
}
3939

40-
integTest.enabled = false
41-
4240
tasks.named("dependencyLicenses").configure {
4341
mapping from: /lucene-.*/, to: 'lucene'
4442
mapping from: /asm-.*/, to: 'asm'

modules/lang-painless/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ restResources {
5454
}
5555
}
5656

57-
integTest.enabled = false
58-
5957
tasks.named("test").configure {
6058
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
6159
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'

modules/systemd/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ esplugin {
2222
classname 'org.elasticsearch.systemd.SystemdPlugin'
2323
}
2424

25-
integTest.enabled = false

plugins/repository-hdfs/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE
2929

3030
apply plugin: 'elasticsearch.test.fixtures'
3131
apply plugin: 'elasticsearch.rest-resources'
32+
apply plugin: 'elasticsearch.rest-test'
3233

3334
esplugin {
3435
description 'The HDFS repository plugin adds support for Hadoop Distributed File-System (HDFS) repositories.'
@@ -94,6 +95,14 @@ tasks.named("dependencyLicenses").configure {
9495
mapping from: /hadoop-.*/, to: 'hadoop'
9596
}
9697

98+
tasks.named("integTest").configure {
99+
it.dependsOn(project.tasks.named("bundlePlugin"))
100+
}
101+
102+
testClusters.integTest {
103+
plugin(project.tasks.bundlePlugin.archiveFile)
104+
}
105+
97106
String realm = "BUILD.ELASTIC.CO"
98107
String krb5conf = project(':test:fixtures:krb5kdc-fixture').ext.krb5Conf("hdfs")
99108

plugins/transport-nio/build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ esplugin {
2626
classname 'org.elasticsearch.transport.nio.NioTransportPlugin'
2727
}
2828

29-
// integTest have been converted to internalClusterTest
30-
integTest.enabled = false
3129
dependencies {
3230
api project(':libs:elasticsearch-nio')
3331

qa/die-with-dignity/build.gradle

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
11
import org.elasticsearch.gradle.info.BuildParams
22

3-
/*
4-
* Licensed to Elasticsearch under one or more contributor
5-
* license agreements. See the NOTICE file distributed with
6-
* this work for additional information regarding copyright
7-
* ownership. Elasticsearch licenses this file to you under
8-
* the Apache License, Version 2.0 (the "License"); you may
9-
* not use this file except in compliance with the License.
10-
* You may obtain a copy of the License at
11-
*
12-
* http://www.apache.org/licenses/LICENSE-2.0
13-
*
14-
* Unless required by applicable law or agreed to in writing,
15-
* software distributed under the License is distributed on an
16-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17-
* KIND, either express or implied. See the License for the
18-
* specific language governing permissions and limitations
19-
* under the License.
20-
*/
21-
22-
apply plugin: 'elasticsearch.testclusters'
3+
apply plugin: 'elasticsearch.java-rest-test'
234
apply plugin: 'elasticsearch.esplugin'
245

256
esplugin {
267
description 'Die with dignity plugin'
278
classname 'org.elasticsearch.DieWithDignityPlugin'
289
}
2910

30-
integTest {
11+
dependencies {
12+
// let the javaRestTest see the classpath of main
13+
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
14+
}
15+
16+
javaRestTest {
3117
systemProperty 'tests.security.manager', 'false'
3218
systemProperty 'tests.system_call_filter', 'false'
33-
nonInputProperties.systemProperty 'log', "${-> testClusters.integTest.singleNode().getServerLog()}"
19+
nonInputProperties.systemProperty 'log', "${-> testClusters.javaRestTest.singleNode().getServerLog()}"
3420
systemProperty 'runtime.java.home', BuildParams.runtimeJavaHome
3521
}
3622

37-
testClusters.integTest {
23+
testClusters.javaRestTest {
3824
systemProperty "die.with.dignity.test", "whatever"
3925
}
4026

4127
test.enabled = false
4228

43-
check.dependsOn integTest

0 commit comments

Comments
 (0)