Skip to content

Commit 232af51

Browse files
nik9000javanna
authored andcommitted
Switch from standalone-test to standalone-rest-test
standalone-rest-test doesn't configure unit tests and for these integ test only tests, that is what we want.
1 parent 812f63e commit 232af51

File tree

18 files changed

+53
-23
lines changed

18 files changed

+53
-23
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ class BuildPlugin implements Plugin<Project> {
5555

5656
@Override
5757
void apply(Project project) {
58-
if (project.pluginManager.hasPlugin('elasticsearch.standalone-test')) {
59-
throw new InvalidUserDataException('elasticsearch.standalone-test and elasticsearch.build are mutually exclusive')
58+
if (project.pluginManager.hasPlugin('elasticsearch.standalone-rest-test')) {
59+
throw new InvalidUserDataException('elasticsearch.standalone-test, '
60+
+ 'elasticearch.standalone-rest-test, and elasticsearch.build '
61+
+ 'are mutually exclusive')
6062
}
6163
project.pluginManager.apply('java')
6264
project.pluginManager.apply('carrotsearch.randomized-testing')

buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class DocsTestPlugin extends RestTestPlugin {
3030

3131
@Override
3232
public void apply(Project project) {
33-
project.pluginManager.apply('elasticsearch.standalone-test')
33+
project.pluginManager.apply('elasticsearch.standalone-rest-test')
3434
super.apply(project)
3535
Map<String, String> defaultSubstitutions = [
3636
/* These match up with the asciidoc syntax for substitutions but

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ import org.gradle.api.Project
2525

2626
/**
2727
* Adds support for starting an Elasticsearch cluster before running integration
28-
* tests. Used in conjunction with {@link StandaloneTestBasePlugin} for qa
28+
* tests. Used in conjunction with {@link StandaloneRestTestPlugin} for qa
2929
* projects and in conjunction with {@link BuildPlugin} for testing the rest
3030
* client.
3131
*/
3232
public class RestTestPlugin implements Plugin<Project> {
3333
List REQUIRED_PLUGINS = [
3434
'elasticsearch.build',
35-
'elasticsearch.standalone-test']
35+
'elasticsearch.standalone-rest-test']
3636

3737
@Override
3838
public void apply(Project project) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy renamed to buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ import org.gradle.api.Project
3030
import org.gradle.api.Task
3131
import org.gradle.api.plugins.JavaBasePlugin
3232

33-
/** Configures the build to have a rest integration test. */
34-
public class StandaloneTestBasePlugin implements Plugin<Project> {
33+
/**
34+
* Configures the build to compile tests against Elasticsearch's test framework
35+
* and run REST tests. Use BuildPlugin if you want to build main code as well
36+
* as tests.
37+
*/
38+
public class StandaloneRestTestPlugin implements Plugin<Project> {
3539

3640
@Override
3741
public void apply(Project project) {
3842
if (project.pluginManager.hasPlugin('elasticsearch.build')) {
39-
throw new InvalidUserDataException('elasticsearch.standalone-test and elasticsearch.build are mutually exclusive')
43+
throw new InvalidUserDataException('elasticsearch.standalone-test, '
44+
+ 'elasticsearch.standalone-test, and elasticsearch.build are '
45+
+ 'mutually exclusive')
4046
}
4147
project.pluginManager.apply(JavaBasePlugin)
4248
project.pluginManager.apply(RandomizedTestingPlugin)

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestPlugin.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ import org.gradle.api.Plugin
2525
import org.gradle.api.Project
2626
import org.gradle.api.plugins.JavaBasePlugin
2727

28-
/** A plugin to add tests only. Used for QA tests that run arbitrary unit tests. */
28+
/**
29+
* Configures the build to compile against Elasticsearch's test framework and
30+
* run integration and unit tests. Use BuildPlugin if you want to build main
31+
* code as well as tests. */
2932
public class StandaloneTestPlugin implements Plugin<Project> {
3033

3134
@Override
3235
public void apply(Project project) {
33-
project.pluginManager.apply(StandaloneTestBasePlugin)
36+
project.pluginManager.apply(StandaloneRestTestPlugin)
3437

3538
Map testOptions = [
3639
name: 'test',
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Licensed to Elasticsearch under one or more contributor
3+
# license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright
5+
# ownership. Elasticsearch licenses this file to you under
6+
# the Apache License, Version 2.0 (the "License"); you may
7+
# not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
implementation-class=org.elasticsearch.gradle.test.StandaloneRestTestPlugin

distribution/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Licensed to Elasticsearch under one or more contributor
2+
// * Licensed to Elasticsearch under one or more contributor
33
* license agreements. See the NOTICE file distributed with
44
* this work for additional information regarding copyright
55
* ownership. Elasticsearch licenses this file to you under
@@ -104,7 +104,7 @@ subprojects {
104104
/*****************************************************************************
105105
* Rest test config *
106106
*****************************************************************************/
107-
apply plugin: 'elasticsearch.standalone-test'
107+
apply plugin: 'elasticsearch.standalone-rest-test'
108108
apply plugin: 'elasticsearch.rest-test'
109109
project.integTest {
110110
dependsOn project.assemble

qa/backwards-5.0/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
apply plugin: 'elasticsearch.standalone-test'
20+
apply plugin: 'elasticsearch.standalone-rest-test'
2121
apply plugin: 'elasticsearch.rest-test'
2222

2323
/* This project runs the core REST tests against a 2 node cluster where one of the nodes has a different minor.

qa/evil-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ thirdPartyAudit.excludes = [
4242
'com.google.common.cache.Striped64$Cell',
4343
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
4444
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
45-
45+
4646
// missing class
4747
'com.ibm.icu.lang.UCharacter',
4848
]

qa/no-bootstrap-tests/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@
2323
*/
2424

2525
apply plugin: 'elasticsearch.standalone-test'
26-

0 commit comments

Comments
 (0)