Skip to content

Commit

Permalink
Dont enable test distribution for legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed May 8, 2024
1 parent d26bad9 commit ca8543d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
Expand Up @@ -20,6 +20,8 @@
import static org.elasticsearch.gradle.internal.test.rest.RestTestUtil.registerTestTask;
import static org.elasticsearch.gradle.internal.test.rest.RestTestUtil.setupJavaRestTestDependenciesDefaults;

import com.gradle.enterprise.gradleplugin.testdistribution.TestDistributionExtension;

/**
* Apply this plugin to run the Java based REST tests.
*/
Expand All @@ -41,6 +43,11 @@ public void apply(Project project) {

// setup the javaRestTest task
TaskProvider<RestIntegTestTask> testTask = registerTestTask(project, javaTestSourceSet, SOURCE_SET_NAME, RestIntegTestTask.class);
testTask.get().useJUnitPlatform();
testTask.get().getExtensions().configure(TestDistributionExtension.class, config -> {
config.getEnabled().set(true);
config.getMaxLocalExecutors().set(0);
});

project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(testTask));

Expand Down
Expand Up @@ -20,6 +20,8 @@
import static org.elasticsearch.gradle.internal.test.rest.RestTestUtil.registerTestTask;
import static org.elasticsearch.gradle.internal.test.rest.RestTestUtil.setupYamlRestTestDependenciesDefaults;

import com.gradle.enterprise.gradleplugin.testdistribution.TestDistributionExtension;

/**
* Apply this plugin to run the YAML based REST tests.
*/
Expand All @@ -37,6 +39,11 @@ public void apply(Project project) {
SourceSet yamlTestSourceSet = sourceSets.create(SOURCE_SET_NAME);

TaskProvider<RestIntegTestTask> testTask = registerTestTask(project, yamlTestSourceSet, SOURCE_SET_NAME, RestIntegTestTask.class);
testTask.get().useJUnitPlatform();
testTask.get().getExtensions().configure(TestDistributionExtension.class, config -> {
config.getEnabled().set(true);
config.getMaxLocalExecutors().set(0);
});

project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME).configure(check -> check.dependsOn(testTask));

Expand Down
Expand Up @@ -120,7 +120,8 @@ public void apply(Project project) {
.registerIfAbsent(
THROTTLE_SERVICE_NAME,
TestClustersThrottle.class,
spec -> spec.getMaxParallelUsages().set(Math.max(1, project.getGradle().getStartParameter().getMaxWorkerCount() / 2))
// spec -> spec.getMaxParallelUsages().set(Math.max(1, project.getGradle().getStartParameter().getMaxWorkerCount() / 2))
spec -> spec.getMaxParallelUsages().set(Math.max(1, 10000)) // TODO
);

project.getTasks().withType(TestClustersAware.class).configureEach(task -> { task.usesService(testClustersThrottleProvider); });
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Expand Up @@ -340,15 +340,15 @@ allprojects {

apply plugin: 'elasticsearch.formatting'

['yamlRestTest', 'javaRestTest'].each { taskName ->
maybeConfigure(project.tasks, taskName) {
it.useJUnitPlatform()
it.distribution {
enabled = true
maxLocalExecutors = 0
}
}
}
// ['yamlRestTest', 'javaRestTest'].each { taskName ->
// maybeConfigure(project.tasks, taskName) {
// it.useJUnitPlatform()
// it.distribution {
// enabled = true
// maxLocalExecutors = 0
// }
// }
// }
}

tasks.register("verifyBwcTestsEnabled") {
Expand Down

0 comments on commit ca8543d

Please sign in to comment.