GH-31 - Fix build resource file detection for test execution optimizations.

This commit is contained in:
Oliver Drotbohm
2024-09-16 17:18:34 +02:00
parent a391e86ee8
commit 3773c0d175
3 changed files with 15 additions and 3 deletions

View File

@@ -255,7 +255,13 @@ public class Changes implements Iterable<Change> {
record OtherFileChange(String path) implements Change {
private static final Collection<String> CLASSPATH_RESOURCES = Set.of("src/main/resources", "src/test/resources");
private static final Collection<String> BUILD_FILES = Set.of("build.gradle", "build.kt", "pom.xml");
private static final Collection<String> BUILD_FILES = Set.of(
// Gradle
"build.gradle", "build.gradle.kts", "gradle.properties", "settings.gradle", "settings.gradle.kts",
// Maven
"pom.xml");
/**
* Returns whether the change affects a build resource.

View File

@@ -49,7 +49,13 @@ class ChangesUnitTests {
@TestFactory // GH-31
Stream<DynamicTest> detectsNonClasspathFileChange() {
var files = Stream.of("pom.xml", "build.gradle", "build.kt");
var files = Stream.of(
// Maven
"pom.xml",
// Gradle
"build.gradle", "build.gradle.kts", "gradle.properties", "settings.gradle", "settings.gradle.kts");
return DynamicTest.stream(files, it -> it + " is considered build resource", it -> {