Skip to content

Commit abd83e8

Browse files
committed
feat: log and skip only non-existent classpath roots
1 parent 66cb7a2 commit abd83e8

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

junit-platform-console/src/main/java/org/junit/platform/console/tasks/DiscoveryRequestCreator.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,9 @@ private static Set<Path> validateAndLogInvalidRoots(Set<Path> roots) {
107107
continue;
108108

109109
boolean exists = Files.exists(root);
110-
boolean readable = Files.isReadable(root);
111-
boolean dirOrJar = isDirOrJar(root);
112110

113-
if (!exists || !readable || !dirOrJar) {
114-
logger.warn(
115-
() -> "Ignoring invalid search path root: %s (exists=%s, readable=%s, dirOrJar=%s)".formatted(root,
116-
exists, readable, dirOrJar));
111+
if (!exists) {
112+
logger.warn(() -> "Ignoring invalid search path root: %s (exists=%s)".formatted(root, exists));
117113
continue;
118114
}
119115
valid.add(root);
@@ -122,10 +118,6 @@ private static Set<Path> validateAndLogInvalidRoots(Set<Path> roots) {
122118
return valid;
123119
}
124120

125-
private static boolean isDirOrJar(Path root) {
126-
return Files.isDirectory(root) || root.toString().endsWith(".jar");
127-
}
128-
129121
private static void addFilters(LauncherDiscoveryRequestBuilder requestBuilder, TestDiscoveryOptions options,
130122
List<? extends DiscoverySelector> selectors) {
131123
requestBuilder.filters(includedClassNamePatterns(options, selectors));

0 commit comments

Comments
 (0)