Browse Source

Port BuildPluginIT to spock (#87104)

We port all our tests for gradle build logic to use spock

Part of #86720
Rene Groeschke 3 years ago
parent
commit
8f31c02dad
22 changed files with 245 additions and 324 deletions
  1. 63 0
      build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/fixtures/TestClasspathUtils.groovy
  2. 175 0
      build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/BuildPluginFuncTest.groovy
  3. 2 2
      build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTaskFuncTest.groovy
  4. 0 63
      build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java
  5. 0 91
      build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java
  6. 4 1
      build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/JarHellPrecommitPlugin.java
  7. 1 1
      build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditPrecommitPlugin.java
  8. 0 1
      build-tools-internal/src/testKit/elasticsearch.build/LICENSE
  9. 0 1
      build-tools-internal/src/testKit/elasticsearch.build/NOTICE
  10. 0 68
      build-tools-internal/src/testKit/elasticsearch.build/build.gradle
  11. 0 11
      build-tools-internal/src/testKit/elasticsearch.build/gradle.properties
  12. 0 10
      build-tools-internal/src/testKit/elasticsearch.build/libs/elasticsearch-core/build.gradle
  13. 0 1
      build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-1.3.jar.sha1
  14. 0 22
      build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-LICENSE.txt
  15. 0 0
      build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-NOTICE.txt
  16. 0 1
      build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-4.12.jar.sha1
  17. 0 22
      build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-LICENSE.txt
  18. 0 0
      build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-NOTICE.txt
  19. 0 2
      build-tools-internal/src/testKit/elasticsearch.build/settings.gradle
  20. 0 15
      build-tools-internal/src/testKit/elasticsearch.build/src/main/java/org/elasticsearch/SampleClass.java
  21. 0 11
      build-tools-internal/src/testKit/elasticsearch.build/test/logger-usage/build.gradle
  22. 0 1
      modules/ingest-geoip/qa/full-cluster-restart/build.gradle

+ 63 - 0
build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/fixtures/TestClasspathUtils.groovy

@@ -0,0 +1,63 @@
+/*
+ * 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 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+package org.elasticsearch.gradle.fixtures
+
+import net.bytebuddy.ByteBuddy
+import net.bytebuddy.description.modifier.Ownership
+import net.bytebuddy.description.modifier.Visibility
+import net.bytebuddy.description.type.TypeDescription
+import net.bytebuddy.dynamic.DynamicType
+import net.bytebuddy.implementation.ExceptionMethod
+import net.bytebuddy.implementation.FixedValue
+import net.bytebuddy.implementation.Implementation
+
+import static org.junit.Assert.fail
+
+class TestClasspathUtils {
+
+    static void setupJarHellJar(File projectRoot) {
+        generateJdkJarHellCheck(projectRoot, "org.elasticsearch.jdk.JarHell", FixedValue.value(TypeDescription.VOID))
+    }
+
+    static void setupJarJdkClasspath(File projectRoot) {
+        generateJdkJarHellCheck(projectRoot, "org.elasticsearch.jdk.JdkJarHellCheck", FixedValue.value(TypeDescription.VOID))
+    }
+
+    static void setupJarJdkClasspath(File projectRoot, String errorMessage) {
+        generateJdkJarHellCheck(projectRoot, "org.elasticsearch.jdk.JdkJarHellCheck",
+                ExceptionMethod.throwing(IllegalStateException.class, errorMessage))
+    }
+
+    private static void generateJdkJarHellCheck(File targetDir, String className, Implementation mainImplementation) {
+        DynamicType.Unloaded<?> dynamicType = new ByteBuddy().subclass(Object.class)
+            .name(className)
+            .defineMethod("main", void.class, Visibility.PUBLIC, Ownership.STATIC)
+            .withParameters(String[].class)
+            .intercept(mainImplementation)
+            .make()
+        try {
+            dynamicType.toJar(targetFile(targetDir))
+        } catch (IOException e) {
+            e.printStackTrace()
+            fail("Cannot setup jdk jar hell classpath")
+        }
+    }
+
+    private static File targetFile(File projectRoot) {
+        File targetFile = new File(projectRoot, "elasticsearch-core-current.jar")
+        targetFile.getParentFile().mkdirs()
+        return targetFile
+    }
+
+    static class JdkJarHellBase {
+        static void main(String[] args) {
+            System.out.println("args = " + args)
+        }
+    }
+}

+ 175 - 0
build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/BuildPluginFuncTest.groovy

@@ -0,0 +1,175 @@
+/*
+ * 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 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+package org.elasticsearch.gradle.internal
+
+import org.apache.commons.io.IOUtils
+import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest
+import org.gradle.testkit.runner.TaskOutcome
+
+import java.nio.charset.StandardCharsets
+import java.util.zip.ZipEntry
+import java.util.zip.ZipFile
+
+import static org.elasticsearch.gradle.fixtures.TestClasspathUtils.setupJarHellJar
+
+class BuildPluginFuncTest extends AbstractGradleFuncTest {
+
+    def EXAMPLE_LICENSE = """\
+        Redistribution and use in source and binary forms, with or without
+        modification, are permitted provided that the following conditions
+        are met:
+        
+         1. Redistributions of source code must retain the above copyright
+            notice, this list of conditions and the following disclaimer.
+         2. Redistributions in binary form must reproduce the above copyright
+            notice, this list of conditions and the following disclaimer in the
+            documentation and/or other materials provided with the distribution.
+         3. The name of the author may not be used to endorse or promote products
+            derived from this software without specific prior written permission.
+        
+        THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+        IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+        OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+        IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+        NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+        DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+        THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+        (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+        THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""".stripIndent()
+
+    def setup() {
+        buildFile << """
+        plugins {
+          id 'java'
+          id 'elasticsearch.global-build-info'
+        }
+       
+        apply plugin:'elasticsearch.build'
+        group = 'org.acme'
+        description = "some example project"
+        
+        repositories {
+          maven {
+            name = "local-test"
+            url = file("local-repo")
+            metadataSources {
+              artifact()
+            }
+          }
+          mavenCentral()
+        }
+        
+        dependencies {
+          jarHell 'org.elasticsearch:elasticsearch-core:current'
+        }
+        """
+        file("LICENSE") << "this is a test license file"
+        file("NOTICE") << "this is a test notice file"
+        file('src/main/java/org/elasticsearch/SampleClass.java') << """\
+          /*
+           * 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 and the Server Side Public License, v 1; you may not use this file except
+           * in compliance with, at your election, the Elastic License 2.0 or the Server
+           * Side Public License, v 1.
+           */
+          package org.elasticsearch;
+          
+          public class SampleClass {
+          }
+        """.stripIndent()
+    }
+    def "plugin can be applied"() {
+        given:
+        buildFile << """
+            tasks.register("hello") {
+              doFirst {
+                println "build plugin can be applied"
+              }
+            }
+            """
+        when:
+        def result = gradleRunner("hello").build()
+        then:
+        result.task(":hello").outcome == TaskOutcome.SUCCESS
+        assertOutputContains(result.getOutput(), "build plugin can be applied")
+    }
+
+    def "packages license and notice file"() {
+        given:
+        buildFile << """
+            licenseFile.set(file("LICENSE"))
+            noticeFile.set(file("NOTICE"))
+            """
+        when:
+        def result = gradleRunner("assemble").build()
+        then:
+        result.task(":assemble").outcome == TaskOutcome.SUCCESS
+        file("build/distributions/hello-world.jar").exists()
+        file("build/distributions/hello-world-javadoc.jar").exists()
+        file("build/distributions/hello-world-sources.jar").exists()
+        assertValidJar(file("build/distributions/hello-world.jar"))
+    }
+
+    def "applies checks"() {
+        given:
+        setupJarHellJar(dir('local-repo/org/elasticsearch/elasticsearch-core/current/'))
+        file("licenses/hamcrest-core-1.3.jar.sha1").text = "42a25dc3219429f0e5d060061f71acb49bf010a0"
+        file("licenses/hamcrest-core-LICENSE.txt").text = EXAMPLE_LICENSE
+        file("licenses/hamcrest-core-NOTICE.txt").text = "mock notice"
+        file("licenses/junit-4.12.jar.sha1").text = "2973d150c0dc1fefe998f834810d68f278ea58ec"
+        file("licenses/junit-LICENSE.txt").text = EXAMPLE_LICENSE
+        file("licenses/junit-NOTICE.txt").text = "mock notice"
+        buildFile << """
+            dependencies {
+              api "junit:junit:4.12"
+              // missing classes in thirdparty audit
+              api 'org.hamcrest:hamcrest-core:1.3'
+
+            }
+            licenseFile.set(file("LICENSE"))
+            noticeFile.set(file("NOTICE"))
+            
+            tasks.named("forbiddenApisMain").configure {enabled = false }
+            tasks.named('checkstyleMain').configure { enabled = false }
+            tasks.named('loggerUsageCheck').configure { enabled = false }
+            // tested elsewhere
+            tasks.named('thirdPartyAudit').configure { enabled = false }
+            """
+        when:
+        def result = gradleRunner("check").build()
+        then:
+        result.task(":licenseHeaders").outcome == TaskOutcome.SUCCESS
+        result.task(":forbiddenPatterns").outcome == TaskOutcome.SUCCESS
+        result.task(":validateModule").outcome == TaskOutcome.SUCCESS
+        result.task(":splitPackagesAudit").outcome == TaskOutcome.SUCCESS
+        result.task(":validateElasticPom").outcome == TaskOutcome.SUCCESS
+        // disabled but check for being on the task graph
+        result.task(":forbiddenApisMain").outcome == TaskOutcome.SKIPPED
+        result.task(":checkstyleMain").outcome == TaskOutcome.SKIPPED
+        result.task(":thirdPartyAudit").outcome == TaskOutcome.SKIPPED
+        result.task(":loggerUsageCheck").outcome == TaskOutcome.SKIPPED
+    }
+
+    def assertValidJar(File jar) {
+        try (ZipFile zipFile = new ZipFile(jar)) {
+            ZipEntry licenseEntry = zipFile.getEntry("META-INF/LICENSE.txt")
+            ZipEntry noticeEntry = zipFile.getEntry("META-INF/NOTICE.txt")
+
+            assert licenseEntry != null : "Jar does not have META-INF/LICENSE.txt"
+            assert noticeEntry != null : "Jar does not have META-INF/NOTICE.txt"
+            try (InputStream license = zipFile.getInputStream(licenseEntry); InputStream notice = zipFile.getInputStream(noticeEntry)) {
+                assert "this is a test license file" == IOUtils.toString(license, StandardCharsets.UTF_8.name())
+                assert "this is a test notice file" == IOUtils.toString(notice, StandardCharsets.UTF_8.name())
+            }
+        }
+        true
+    }
+}

+ 2 - 2
build-tools-internal/src/integTest/groovy/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditTaskFuncTest.groovy

@@ -18,7 +18,7 @@ import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest
 import org.gradle.testkit.runner.TaskOutcome
 
 
-import static org.elasticsearch.gradle.internal.test.TestClasspathUtils.setupJarJdkClasspath
+import static org.elasticsearch.gradle.fixtures.TestClasspathUtils.setupJarJdkClasspath
 
 class ThirdPartyAuditTaskFuncTest extends AbstractGradleFuncTest {
 
@@ -154,7 +154,7 @@ class ThirdPartyAuditTaskFuncTest extends AbstractGradleFuncTest {
         setupJarJdkClasspath(
                 dir('local-repo/org/elasticsearch/elasticsearch-core/current/'),
                 "> Audit of third party dependencies failed:" + "   Jar Hell with the JDK:" + "    * java.lang.String"
-        );
+        )
         buildFile << """
             dependencies {
               jdkJarHell 'org.elasticsearch:elasticsearch-core:current'

+ 0 - 63
build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/BuildPluginIT.java

@@ -1,63 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-package org.elasticsearch.gradle.internal;
-
-import org.apache.commons.io.IOUtils;
-import org.elasticsearch.gradle.internal.test.GradleIntegrationTestCase;
-import org.gradle.testkit.runner.BuildResult;
-import org.junit.Rule;
-import org.junit.rules.TemporaryFolder;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.StandardCharsets;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import static org.elasticsearch.gradle.internal.test.TestClasspathUtils.setupJarJdkClasspath;
-
-public class BuildPluginIT extends GradleIntegrationTestCase {
-
-    @Rule
-    public TemporaryFolder tmpDir = new TemporaryFolder();
-
-    @Override
-    public String projectName() {
-        return "elasticsearch.build";
-    }
-
-    public void testPluginCanBeApplied() {
-        BuildResult result = getGradleRunner().withArguments("hello", "-s").build();
-        assertTaskSuccessful(result, ":hello");
-        assertOutputContains("build plugin can be applied");
-    }
-
-    public void testCheckTask() {
-        setupJarJdkClasspath(new File(getProjectDir(), "sample_jars/build/testrepo/org/elasticsearch/elasticsearch-core/current/"));
-        BuildResult result = getGradleRunner().withArguments("check", "assemble", "-s").build();
-        assertTaskSuccessful(result, ":check");
-    }
-
-    public void testLicenseAndNotice() throws IOException {
-        BuildResult result = getGradleRunner().withArguments("clean", "assemble").build();
-        assertTaskSuccessful(result, ":assemble");
-        String expectedFilePath = "distributions/elasticsearch.build.jar";
-        assertBuildFileExists(result, projectName(), expectedFilePath);
-        try (ZipFile zipFile = new ZipFile(new File(getBuildDir(projectName()), expectedFilePath))) {
-            ZipEntry licenseEntry = zipFile.getEntry("META-INF/LICENSE.txt");
-            ZipEntry noticeEntry = zipFile.getEntry("META-INF/NOTICE.txt");
-            assertNotNull("Jar does not have META-INF/LICENSE.txt", licenseEntry);
-            assertNotNull("Jar does not have META-INF/NOTICE.txt", noticeEntry);
-            try (InputStream license = zipFile.getInputStream(licenseEntry); InputStream notice = zipFile.getInputStream(noticeEntry)) {
-                assertEquals("this is a test license file", IOUtils.toString(license, StandardCharsets.UTF_8.name()));
-                assertEquals("this is a test notice file", IOUtils.toString(notice, StandardCharsets.UTF_8.name()));
-            }
-        }
-    }
-}

+ 0 - 91
build-tools-internal/src/integTest/java/org/elasticsearch/gradle/internal/test/TestClasspathUtils.java

@@ -1,91 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.gradle.internal.test;
-
-import net.bytebuddy.ByteBuddy;
-import net.bytebuddy.description.modifier.Ownership;
-import net.bytebuddy.description.modifier.Visibility;
-import net.bytebuddy.description.type.TypeDescription;
-import net.bytebuddy.dynamic.DynamicType;
-import net.bytebuddy.dynamic.scaffold.InstrumentedType;
-import net.bytebuddy.implementation.ExceptionMethod;
-import net.bytebuddy.implementation.FixedValue;
-import net.bytebuddy.implementation.Implementation;
-import net.bytebuddy.implementation.bytecode.ByteCodeAppender;
-
-import java.io.File;
-import java.io.IOException;
-
-import static org.junit.Assert.fail;
-
-public class TestClasspathUtils {
-
-    public static void setupJarJdkClasspath(File projectRoot) {
-        generateJdkJarHellCheck(projectRoot, FixedValue.value(TypeDescription.VOID));
-    }
-
-    public static void setupJarJdkClasspath(File projectRoot, String errorMessage) {
-        generateJdkJarHellCheck(projectRoot, ExceptionMethod.throwing(IllegalStateException.class, errorMessage));
-    }
-
-    private static void generateJdkJarHellCheck(File targetDir, Implementation mainImplementation) {
-        DynamicType.Unloaded<?> dynamicType = new ByteBuddy().subclass(Object.class)
-            .name("org.elasticsearch.jdk.JdkJarHellCheck")
-            .defineMethod("main", void.class, Visibility.PUBLIC, Ownership.STATIC)
-            .withParameters(String[].class)
-            .intercept(mainImplementation)
-            .make();
-        try {
-            dynamicType.toJar(targetFile(targetDir));
-        } catch (IOException e) {
-            e.printStackTrace();
-            fail("Cannot setup jdk jar hell classpath");
-        }
-    }
-
-    private static void genenerateJar(File projectRoot, Implementation mainImplementation) {
-        DynamicType.Unloaded<?> dynamicType = new ByteBuddy().subclass(Object.class)
-            .name("org.elasticsearch.jdk.JdkJarHellCheck")
-            .defineMethod("main", void.class, Visibility.PUBLIC, Ownership.STATIC)
-            .withParameters(String[].class)
-            .intercept(mainImplementation)
-            .make();
-        try {
-            dynamicType.toJar(targetFile(projectRoot));
-        } catch (IOException e) {
-            e.printStackTrace();
-            fail("Cannot setup jdk jar hell classpath");
-        }
-    }
-
-    private static File targetFile(File projectRoot) {
-        File targetFile = new File(projectRoot, "elasticsearch-core-current.jar");
-
-        targetFile.getParentFile().mkdirs();
-        return targetFile;
-    }
-
-    private static class InconsistentParameterReferenceMethod implements net.bytebuddy.implementation.Implementation {
-        @Override
-        public ByteCodeAppender appender(Target implementationTarget) {
-            return null;
-        }
-
-        @Override
-        public InstrumentedType prepare(InstrumentedType instrumentedType) {
-            return null;
-        }
-    }
-
-    public static class JdkJarHellBase {
-        public static void main(String[] args) {
-            System.out.println("args = " + args);
-        }
-    }
-}

+ 4 - 1
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/JarHellPrecommitPlugin.java

@@ -24,7 +24,10 @@ public class JarHellPrecommitPlugin extends PrecommitPlugin {
             // ideally we would configure this as a default dependency. But Default dependencies do not work correctly
             // with gradle project dependencies as they're resolved to late in the build and don't setup according task
             // dependencies properly
-            project.getDependencies().add("jarHell", project.project(":libs:elasticsearch-core"));
+            var elasticsearchCoreProject = project.findProject(":libs:elasticsearch-core");
+            if (elasticsearchCoreProject != null) {
+                project.getDependencies().add("jarHell", elasticsearchCoreProject);
+            }
         }
 
         return project.getTasks().withType(JarHellTask.class).named("jarHell");

+ 1 - 1
build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/precommit/ThirdPartyAuditPrecommitPlugin.java

@@ -37,7 +37,7 @@ public class ThirdPartyAuditPrecommitPlugin extends PrecommitPlugin implements I
             // we are not doing this for this project itself to avoid jar hell with itself
             var elasticsearchCoreProject = project.findProject(LIBS_ELASTICSEARCH_CORE_PROJECT_PATH);
             if (elasticsearchCoreProject != null) {
-                project.getDependencies().add(JDK_JAR_HELL_CONFIG_NAME, project.project(LIBS_ELASTICSEARCH_CORE_PROJECT_PATH));
+                project.getDependencies().add(JDK_JAR_HELL_CONFIG_NAME, elasticsearchCoreProject);
             }
         }
 

+ 0 - 1
build-tools-internal/src/testKit/elasticsearch.build/LICENSE

@@ -1 +0,0 @@
-this is a test license file

+ 0 - 1
build-tools-internal/src/testKit/elasticsearch.build/NOTICE

@@ -1 +0,0 @@
-this is a test notice file

+ 0 - 68
build-tools-internal/src/testKit/elasticsearch.build/build.gradle

@@ -1,68 +0,0 @@
-plugins {
-  id 'java'
-  id 'elasticsearch.global-build-info'
-}
-
-apply plugin:'elasticsearch.build'
-
-licenseFile.set(file("LICENSE"))
-noticeFile.set(file("NOTICE"))
-
-dependencies {
-  api "junit:junit:${versions.junit}"
-  // missing classes in thirdparty audit
-  api 'org.hamcrest:hamcrest-core:1.3'
-  jdkJarHell 'org.elasticsearch:elasticsearch-core:current'
-}
-
-repositories {
-  /**
-   * Local test repo contains dummy jars with different group names and versions.
-   *   - broken-log4j creates a log4j logger but has no pom, so the class will be missing
-   *   - dummy-io has a class that creates a new java.io.File ( something which third-party-audit-absurd.txt forbids )
-   *   - version 0.0.2 has the same class and one extra file just to make the jar different
-   *   - used for propagating jar containing jdkjarhell jar from integ test runtime classpath
-   */
-  maven {
-    name = "local-test"
-    url = file("sample_jars/build/testrepo")
-    metadataSources {
-      artifact()
-    }
-  }
-  mavenCentral()
-}
-
-repositories {
-  /**
-   * Local test repo contains jdkjarhell jar from integ test runtime classpath propagated at runtime
-   */
-  maven {
-    name = "local-test"
-    url = file("sample_jars/build/testrepo")
-    metadataSources {
-      artifact()
-    }
-  }
-  mavenCentral()
-}
-
-// todo remove offending rules
-
-// requires dependency on testing fw
-tasks.named("jarHell").configure {enabled = false }
-// we don't have tests for now
-tasks.named("test").configure {enabled = false }
-// we don't have tests for now
-tasks.named("forbiddenApisMain").configure {enabled = false }
-// TODO: shouldn't be part of BuildPlugin, should be tested separately
-tasks.named("validateElasticPom").configure {enabled = false }
-// requires further classpath
-tasks.named("loggerUsageCheck").configure {enabled = false }
-tasks.register("hello") {
-  doFirst {
-    println "build plugin can be applied"
-  }
-}
-// requires further classpath
-tasks.named("checkstyleMain").configure {enabled = false }

+ 0 - 11
build-tools-internal/src/testKit/elasticsearch.build/gradle.properties

@@ -1,11 +0,0 @@
-#
-# 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 and the Server Side Public License, v 1; you may not use this file except
-# in compliance with, at your election, the Elastic License 2.0 or the Server
-# Side Public License, v 1.
-#
-
-# java homes resolved by environment variables
-org.gradle.java.installations.auto-detect=false
-org.gradle.java.installations.fromEnv=JAVA_HOME,RUNTIME_JAVA_HOME,JAVA15_HOME,JAVA14_HOME,JAVA13_HOME,JAVA12_HOME,JAVA11_HOME,JAVA8_HOME

+ 0 - 10
build-tools-internal/src/testKit/elasticsearch.build/libs/elasticsearch-core/build.gradle

@@ -1,10 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-// dummy project for testing purposes
-apply plugin:'java'

+ 0 - 1
build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-1.3.jar.sha1

@@ -1 +0,0 @@
-42a25dc3219429f0e5d060061f71acb49bf010a0

+ 0 - 22
build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-LICENSE.txt

@@ -1,22 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 0 - 0
build-tools-internal/src/testKit/elasticsearch.build/licenses/hamcrest-core-NOTICE.txt


+ 0 - 1
build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-4.12.jar.sha1

@@ -1 +0,0 @@
-2973d150c0dc1fefe998f834810d68f278ea58ec

+ 0 - 22
build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-LICENSE.txt

@@ -1,22 +0,0 @@
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
- 3. The name of the author may not be used to endorse or promote products
-    derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 0 - 0
build-tools-internal/src/testKit/elasticsearch.build/licenses/junit-NOTICE.txt


+ 0 - 2
build-tools-internal/src/testKit/elasticsearch.build/settings.gradle

@@ -1,2 +0,0 @@
-include ":libs:elasticsearch-core"
-include ":test:logger-usage"

+ 0 - 15
build-tools-internal/src/testKit/elasticsearch.build/src/main/java/org/elasticsearch/SampleClass.java

@@ -1,15 +0,0 @@
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-package org.elasticsearch;
-
-/**
- * This is just a test class
- */
-public class SampleClass {
-
-}

+ 0 - 11
build-tools-internal/src/testKit/elasticsearch.build/test/logger-usage/build.gradle

@@ -1,11 +0,0 @@
-
-/*
- * 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 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-// dummy project for testing purposes
-apply plugin:'java'

+ 0 - 1
modules/ingest-geoip/qa/full-cluster-restart/build.gradle

@@ -37,7 +37,6 @@ tasks.withType(Test).configureEach {
   }
 }
 
-
 BuildParams.bwcVersions.withWireCompatible(v -> v.before("8.0.0")) { bwcVersion, baseName ->
   def baseCluster = testClusters.register(baseName) {
     testDistribution = "DEFAULT"