Skip to content

Commit

Permalink
Fix failing test cases with changes from pull from exemptions pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Aug 8, 2024
1 parent dad1370 commit 83836bc
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@ class CoverageRunner(
bazelTestTarget: String
): List<CoverageReport> {
val coverageResults = bazelClient.runCoverageForTestTarget(bazelTestTarget)
check(coverageResults.isNotEmpty()) {
"Failed to retrieve coverage results for $bazelTestTarget."
}
return coverageResults.map { singleCoverageDatFileLines ->
parseCoverageDataFileLines(singleCoverageDatFileLines, bazelTestTarget)
}

return coverageResults
.takeIf { it.isNotEmpty() }
?.map { singleCoverageDatFileLines ->
parseCoverageDataFileLines(singleCoverageDatFileLines, bazelTestTarget)
}
?: listOf(
generateFailedCoverageReport(
bazelTestTarget,
"Coverage retrieval failed for the test target: $bazelTestTarget"
)
)
}

private fun parseCoverageDataFileLines(
Expand Down

0 comments on commit 83836bc

Please sign in to comment.