Skip to content

Commit

Permalink
Code cleanup and fix lint checks for missing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Jul 6, 2024
1 parent 5f9ae7a commit 45067f7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,9 @@ class BazelClient(private val rootDirectory: File, private val commandExecutor:
* or null if the coverage data file could not be parsed
*/
fun runCoverageForTestTarget(bazelTestTarget: String): List<String>? {
// val computeInstrumentation = bazelTestTarget.split("/").let { "//${it[2]}/..." }
val instrumentation = bazelTestTarget.split(":")[0]
val computeInstrumentation = instrumentation.split("/").let {"//${it[2]}/..."}
val computeInstrumentation = instrumentation.split("/").let { "//${it[2]}/..." }
println("compute: $computeInstrumentation")
// val computeInstrumentation = "//"
val coverageCommandOutputLines = executeBazelCommand(
"coverage",
bazelTestTarget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ class CoverageReporter(
}

private fun computeCoverageRatio(): Float {
// val report = coverageReportList.getOrNull(0)
return if (coverageReport.linesFound != 0) {
coverageReport.linesHit.toFloat() / coverageReport.linesFound.toFloat()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,14 @@ class RunCoverage(
}

val testFilePaths = findTestFile(repoRoot, filePath)
println("Test file paths: $testFilePaths")
if (testFilePaths.isEmpty()) {
error("No appropriate test file found for $filePath")
}

val testTargets = bazelClient.retrieveBazelTargets(testFilePaths)
println("Test Targets: $testTargets")

/*since I couldn't actually find any multi test target : file ones to test
* I am probably for now introducing mock data to test multi aggregated coverage report
* I am for now introducing mock data to test multi aggregated coverage report
* also that's going to save me a light year :|
* */

Expand Down

0 comments on commit 45067f7

Please sign in to comment.