Split x-pack testing into multiple CI jobs (#88697)
This commit is contained in:
parent
a51c66d95e
commit
d2c52ef495
|
@ -11,6 +11,7 @@ package org.elasticsearch.gradle.internal;
|
||||||
import groovy.lang.Closure;
|
import groovy.lang.Closure;
|
||||||
|
|
||||||
import org.elasticsearch.gradle.internal.conventions.util.Util;
|
import org.elasticsearch.gradle.internal.conventions.util.Util;
|
||||||
|
import org.elasticsearch.gradle.internal.info.BuildParams;
|
||||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
|
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
|
||||||
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
|
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
|
||||||
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster;
|
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster;
|
||||||
|
@ -48,18 +49,21 @@ public class BaseInternalPluginBuildPlugin implements Plugin<Project> {
|
||||||
.getExtraProperties()
|
.getExtraProperties()
|
||||||
.set("addQaCheckDependencies", new Closure<Project>(BaseInternalPluginBuildPlugin.this, BaseInternalPluginBuildPlugin.this) {
|
.set("addQaCheckDependencies", new Closure<Project>(BaseInternalPluginBuildPlugin.this, BaseInternalPluginBuildPlugin.this) {
|
||||||
public void doCall(Project proj) {
|
public void doCall(Project proj) {
|
||||||
proj.afterEvaluate(project1 -> {
|
// This is only a convenience for local developers so make this a noop when running in CI
|
||||||
// let check depend on check tasks of qa sub-projects
|
if (BuildParams.isCi() == false) {
|
||||||
final var checkTaskProvider = project1.getTasks().named("check");
|
proj.afterEvaluate(project1 -> {
|
||||||
Optional<Project> qaSubproject = project1.getSubprojects()
|
// let check depend on check tasks of qa sub-projects
|
||||||
.stream()
|
final var checkTaskProvider = project1.getTasks().named("check");
|
||||||
.filter(p -> p.getPath().equals(project1.getPath() + ":qa"))
|
Optional<Project> qaSubproject = project1.getSubprojects()
|
||||||
.findFirst();
|
.stream()
|
||||||
qaSubproject.ifPresent(
|
.filter(p -> p.getPath().equals(project1.getPath() + ":qa"))
|
||||||
qa -> qa.getSubprojects()
|
.findFirst();
|
||||||
.forEach(p -> checkTaskProvider.configure(task -> task.dependsOn(p.getPath() + ":check")))
|
qaSubproject.ifPresent(
|
||||||
);
|
qa -> qa.getSubprojects()
|
||||||
});
|
.forEach(p -> checkTaskProvider.configure(task -> task.dependsOn(p.getPath() + ":check")))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doCall() {
|
public void doCall() {
|
||||||
|
|
37
build.gradle
37
build.gradle
|
@ -6,28 +6,26 @@
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin
|
||||||
import com.avast.gradle.dockercompose.tasks.ComposePull
|
import com.avast.gradle.dockercompose.tasks.ComposePull
|
||||||
import com.fasterxml.jackson.databind.JsonNode
|
import com.fasterxml.jackson.databind.JsonNode
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper
|
import com.fasterxml.jackson.databind.ObjectMapper
|
||||||
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
|
|
||||||
import de.thetaphi.forbiddenapis.gradle.ForbiddenApisPlugin
|
|
||||||
import org.elasticsearch.gradle.internal.BuildPlugin
|
|
||||||
import org.elasticsearch.gradle.Version
|
|
||||||
import org.elasticsearch.gradle.VersionProperties
|
|
||||||
import org.elasticsearch.gradle.internal.BwcVersions
|
|
||||||
import org.elasticsearch.gradle.internal.info.BuildParams
|
|
||||||
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
|
|
||||||
import org.gradle.plugins.ide.eclipse.model.AccessRule
|
|
||||||
import org.gradle.util.DistributionLocator
|
|
||||||
import org.gradle.util.GradleVersion
|
|
||||||
import org.elasticsearch.gradle.util.GradleUtils
|
|
||||||
|
|
||||||
import static org.elasticsearch.gradle.util.GradleUtils.maybeConfigure
|
import org.elasticsearch.gradle.Version
|
||||||
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
|
|
||||||
import org.elasticsearch.gradle.internal.BaseInternalPluginBuildPlugin
|
import org.elasticsearch.gradle.internal.BaseInternalPluginBuildPlugin
|
||||||
import org.elasticsearch.gradle.internal.ResolveAllDependencies
|
import org.elasticsearch.gradle.internal.ResolveAllDependencies
|
||||||
|
import org.elasticsearch.gradle.internal.info.BuildParams
|
||||||
|
import org.elasticsearch.gradle.util.GradleUtils
|
||||||
|
import org.gradle.plugins.ide.eclipse.model.AccessRule
|
||||||
|
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
|
||||||
|
import org.gradle.util.DistributionLocator
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
|
|
||||||
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
|
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING
|
||||||
|
import static org.elasticsearch.gradle.util.GradleUtils.maybeConfigure
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'lifecycle-base'
|
id 'lifecycle-base'
|
||||||
|
@ -208,14 +206,15 @@ allprojects {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def checkPart1 = tasks.register('checkPart1')
|
|
||||||
def checkPart2 = tasks.register('checkPart2')
|
|
||||||
def checkPart3 = tasks.register('checkPart3')
|
|
||||||
plugins.withId('lifecycle-base') {
|
plugins.withId('lifecycle-base') {
|
||||||
if (project.path.startsWith(":x-pack:")) {
|
if (project.path.startsWith(":x-pack:")) {
|
||||||
checkPart2.configure { dependsOn 'check' }
|
if (project.path.contains("security") || project.path.contains(":ml")) {
|
||||||
|
tasks.register('checkPart3') { dependsOn 'check' }
|
||||||
|
} else {
|
||||||
|
tasks.register('checkPart2') { dependsOn 'check' }
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
checkPart1.configure { dependsOn 'check' }
|
tasks.register('checkPart1') { dependsOn 'check' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue