Browse Source

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.
Nik Everett 8 years ago
parent
commit
232af512f4

+ 4 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

@@ -55,8 +55,10 @@ class BuildPlugin implements Plugin<Project> {
 
     @Override
     void apply(Project project) {
-        if (project.pluginManager.hasPlugin('elasticsearch.standalone-test')) {
-              throw new InvalidUserDataException('elasticsearch.standalone-test and elasticsearch.build are mutually exclusive')
+        if (project.pluginManager.hasPlugin('elasticsearch.standalone-rest-test')) {
+              throw new InvalidUserDataException('elasticsearch.standalone-test, '
+                + 'elasticearch.standalone-rest-test, and elasticsearch.build '
+                + 'are mutually exclusive')
         }
         project.pluginManager.apply('java')
         project.pluginManager.apply('carrotsearch.randomized-testing')

+ 1 - 1
buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/DocsTestPlugin.groovy

@@ -30,7 +30,7 @@ public class DocsTestPlugin extends RestTestPlugin {
 
     @Override
     public void apply(Project project) {
-        project.pluginManager.apply('elasticsearch.standalone-test')
+        project.pluginManager.apply('elasticsearch.standalone-rest-test')
         super.apply(project)
         Map<String, String> defaultSubstitutions = [
             /* These match up with the asciidoc syntax for substitutions but

+ 2 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestTestPlugin.groovy

@@ -25,14 +25,14 @@ import org.gradle.api.Project
 
 /**
  * Adds support for starting an Elasticsearch cluster before running integration
- * tests. Used in conjunction with {@link StandaloneTestBasePlugin} for qa
+ * tests. Used in conjunction with {@link StandaloneRestTestPlugin} for qa
  * projects and in conjunction with {@link BuildPlugin} for testing the rest
  * client.
  */
 public class RestTestPlugin implements Plugin<Project> {
     List REQUIRED_PLUGINS = [
         'elasticsearch.build',
-        'elasticsearch.standalone-test']
+        'elasticsearch.standalone-rest-test']
 
     @Override
     public void apply(Project project) {

+ 9 - 3
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestBasePlugin.groovy → buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneRestTestPlugin.groovy

@@ -30,13 +30,19 @@ import org.gradle.api.Project
 import org.gradle.api.Task
 import org.gradle.api.plugins.JavaBasePlugin
 
-/** Configures the build to have a rest integration test.  */
-public class StandaloneTestBasePlugin implements Plugin<Project> {
+/**
+ * Configures the build to compile tests against Elasticsearch's test framework
+ * and run REST tests. Use BuildPlugin if you want to build main code as well
+ * as tests.
+ */
+public class StandaloneRestTestPlugin implements Plugin<Project> {
 
     @Override
     public void apply(Project project) {
         if (project.pluginManager.hasPlugin('elasticsearch.build')) {
-            throw new InvalidUserDataException('elasticsearch.standalone-test and elasticsearch.build are mutually exclusive')
+            throw new InvalidUserDataException('elasticsearch.standalone-test, '
+                + 'elasticsearch.standalone-test, and elasticsearch.build are '
+                + 'mutually exclusive')
         }
         project.pluginManager.apply(JavaBasePlugin)
         project.pluginManager.apply(RandomizedTestingPlugin)

+ 5 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/StandaloneTestPlugin.groovy

@@ -25,12 +25,15 @@ import org.gradle.api.Plugin
 import org.gradle.api.Project
 import org.gradle.api.plugins.JavaBasePlugin
 
-/** A plugin to add tests only. Used for QA tests that run arbitrary unit tests. */
+/**
+ * Configures the build to compile against Elasticsearch's test framework and
+ * run integration and unit tests. Use BuildPlugin if you want to build main
+ * code as well as tests. */
 public class StandaloneTestPlugin implements Plugin<Project> {
 
     @Override
     public void apply(Project project) {
-        project.pluginManager.apply(StandaloneTestBasePlugin)
+        project.pluginManager.apply(StandaloneRestTestPlugin)
 
         Map testOptions = [
             name: 'test',

+ 20 - 0
buildSrc/src/main/resources/META-INF/gradle-plugins/elasticsearch.standalone-rest-test.properties

@@ -0,0 +1,20 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you under
+# the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+implementation-class=org.elasticsearch.gradle.test.StandaloneRestTestPlugin

+ 2 - 2
distribution/build.gradle

@@ -1,5 +1,5 @@
 /*
- * Licensed to Elasticsearch under one or more contributor
+ // * Licensed to Elasticsearch under one or more contributor
  * license agreements. See the NOTICE file distributed with
  * this work for additional information regarding copyright
  * ownership. Elasticsearch licenses this file to you under
@@ -104,7 +104,7 @@ subprojects {
   /*****************************************************************************
    *                            Rest test config                               *
    *****************************************************************************/
-  apply plugin: 'elasticsearch.standalone-test'
+  apply plugin: 'elasticsearch.standalone-rest-test'
   apply plugin: 'elasticsearch.rest-test'
   project.integTest {
     dependsOn project.assemble

+ 1 - 1
qa/backwards-5.0/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 /* This project runs the core REST tests against a 2 node cluster where one of the nodes has a different minor.

+ 1 - 1
qa/evil-tests/build.gradle

@@ -42,7 +42,7 @@ thirdPartyAudit.excludes = [
   'com.google.common.cache.Striped64$Cell',
   'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
   'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
-  
+
   // missing class
   'com.ibm.icu.lang.UCharacter',
 ]

+ 0 - 1
qa/no-bootstrap-tests/build.gradle

@@ -23,4 +23,3 @@
  */
 
 apply plugin: 'elasticsearch.standalone-test'
-

+ 1 - 1
qa/smoke-test-client/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 // TODO: this test works, but it isn't really a rest test...should we have another plugin for "non rest test that just needs N clusters?"

+ 1 - 1
qa/smoke-test-http/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 dependencies {

+ 1 - 1
qa/smoke-test-ingest-disabled/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 dependencies {

+ 1 - 1
qa/smoke-test-ingest-with-all-dependencies/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 dependencies {

+ 1 - 1
qa/smoke-test-multinode/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 integTest {

+ 1 - 1
qa/smoke-test-plugins/build.gradle

@@ -19,7 +19,7 @@
 
 import org.elasticsearch.gradle.MavenFilteringHack
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 ext.pluginsCount = 0

+ 1 - 1
qa/smoke-test-reindex-with-painless/build.gradle

@@ -17,7 +17,7 @@
  * under the License.
  */
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 integTest {

+ 1 - 1
qa/smoke-test-tribe-node/build.gradle

@@ -21,7 +21,7 @@ import org.elasticsearch.gradle.test.ClusterConfiguration
 import org.elasticsearch.gradle.test.ClusterFormationTasks
 import org.elasticsearch.gradle.test.NodeInfo
 
-apply plugin: 'elasticsearch.standalone-test'
+apply plugin: 'elasticsearch.standalone-rest-test'
 apply plugin: 'elasticsearch.rest-test'
 
 List<NodeInfo> oneNodes