diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/InstrumentedFilesCollector.java b/src/main/java/com/google/devtools/build/lib/analysis/test/InstrumentedFilesCollector.java index d2f5926d715c73..39aa12d2a682ec 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/InstrumentedFilesCollector.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/InstrumentedFilesCollector.java @@ -208,7 +208,7 @@ public static InstrumentedFilesInfo collect( for (TransitiveInfoCollection dep : getPrerequisitesForAttributes(ruleContext, spec.sourceAttributes)) { for (Artifact artifact : dep.getProvider(FileProvider.class).getFilesToBuild().toList()) { - if (artifact.isSourceArtifact() && + if (!artifact.isDirectory() && spec.instrumentedFileTypes.matches(artifact.getFilename())) { localSourcesBuilder.add(artifact); }