Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Sep 4, 2024
1 parent 997de87 commit 29fc839
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.gradle.api.tasks.Sync;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.testing.Test;
import org.gradle.language.jvm.tasks.ProcessResources;

import java.io.File;
import java.nio.file.Path;
Expand Down Expand Up @@ -213,6 +214,16 @@ public void apply(Project project) {
.named(RestResourcesPlugin.COPY_YAML_TESTS_TASK)
.flatMap(CopyRestTestsTask::getOutputResourceDir);

// ensure we include other non rest spec related test resources
project.getTasks()
.withType(ProcessResources.class)
.named(yamlCompatTestSourceSet.getProcessResourcesTaskName())
.configure(processResources -> {
processResources.from(sourceSets.getByName(YamlRestTestPlugin.YAML_REST_TEST).getResources(), spec -> {
spec.exclude("rest-api-spec/**");
});
});

// setup the test task
TaskProvider<? extends Test> yamlRestCompatTestTask = registerTestTask(project, yamlCompatTestSourceSet);
yamlRestCompatTestTask.configure(testTask -> {
Expand All @@ -225,7 +236,7 @@ public void apply(Project project) {
testTask.setClasspath(
yamlCompatTestSourceSet.getRuntimeClasspath()
// remove the "normal" api and tests
.minus(project.files(new File(yamlTestSourceSet.getOutput().getResourcesDir(), "rest-api-spec")))
.minus(project.files(yamlTestSourceSet.getOutput().getResourcesDir()))
.minus(project.files(originalYamlSpecsDir))
.minus(project.files(originalYamlTestsDir))
);
Expand Down
7 changes: 2 additions & 5 deletions modules/data-streams/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask

apply plugin: 'elasticsearch.test-with-dependencies'
apply plugin: 'elasticsearch.internal-cluster-test'
Expand All @@ -23,11 +24,7 @@ dependencies {
internalClusterTestImplementation project(":modules:mapper-extras")
}

tasks.named('yamlRestTest') {
usesDefaultDistribution()
}

tasks.named('javaRestTest') {
tasks.withType(StandaloneRestIntegTestTask).configureEach {
usesDefaultDistribution()
}

Expand Down

0 comments on commit 29fc839

Please sign in to comment.