Skip to content

Commit c9f1b4d

Browse files
fix: log the original display name if no parent has a source (#362)
1 parent 54d9a95 commit c9f1b4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/src/com/github/bazel_contrib/contrib_rules_jvm/junit5/PatternFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public FilterResult apply(TestDescriptor object) {
4646
// Find the first parent with a source and apply the filter to that.
4747
// This lets running individual tests in IDEs like IntelliJ work while also
4848
// running all tests without sources when the '.*' pattern is set.
49+
String testDisplayName = object.getDisplayName();
4950
while (!object.getSource().isPresent()) {
5051
object = object.getParent().orElse(null);
5152
if (object == null) {
52-
return FilterResult.excluded(
53-
"Skipping a test without a source: " + object.getDisplayName());
53+
return FilterResult.excluded("Skipping a test without a source: " + testDisplayName);
5454
}
5555
}
5656

0 commit comments

Comments
 (0)