Skip to content

Commit 5cdf848

Browse files
Do not skip cov report creation if a source path cannot be determined
1 parent ae74591 commit 5cdf848

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/file/FileCoverageStore.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ protected TestReport report(
6767
"Skipping coverage reporting for {} because source path could not be determined",
6868
clazz);
6969
metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1, CoverageErrorType.PATH);
70-
// Abort, since we cannot gather complete and accurate coverage.
71-
// No coverage will be submitted, and ITR will not skip this test.
72-
return null;
70+
continue;
7371
}
7472
coveredPaths.add(sourcePath);
7573
}
@@ -81,9 +79,7 @@ protected TestReport report(
8179
"Skipping coverage reporting for {} because resource path could not be determined",
8280
nonCodeResource);
8381
metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1, CoverageErrorType.PATH);
84-
// Abort, since we cannot gather complete and accurate coverage.
85-
// No coverage will be submitted, and ITR will not skip this test.
86-
return null;
82+
continue;
8783
}
8884
coveredPaths.add(resourcePath);
8985
}

dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/LineCoverageStore.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ protected TestReport report(
8080
"Skipping coverage reporting for {} because source path could not be determined",
8181
className);
8282
metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1, CoverageErrorType.PATH);
83-
// Abort, since we cannot gather complete and accurate coverage.
84-
// No coverage will be submitted, and ITR will not skip this test.
85-
return null;
83+
continue;
8684
}
8785

8886
try (InputStream is = Utils.getClassStream(clazz)) {
@@ -126,9 +124,7 @@ protected TestReport report(
126124
"Skipping coverage reporting for {} because resource path could not be determined",
127125
nonCodeResource);
128126
metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1, CoverageErrorType.PATH);
129-
// Abort, since we cannot gather complete and accurate coverage.
130-
// No coverage will be submitted, and ITR will not skip this test.
131-
return null;
127+
continue;
132128
}
133129
fileEntries.add(new TestReportFileEntry(resourcePath, Collections.emptyList()));
134130
}

0 commit comments

Comments
 (0)