Skip to content

Commit

Permalink
Cleanup of RunCoverageTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Jun 20, 2024
1 parent fdaf9cb commit 8e28f1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
15 changes: 0 additions & 15 deletions scripts/src/java/org/oppia/android/scripts/coverage/RunCoverage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,11 @@ class RunCoverage(
val isExempted = testFileExemptionList.contains(filePath)
if (isExempted) {
println("This file is exempted from having a test file. Hence No coverage!")
// return null
return emptyList()
}

// val bazelClient = BazelClient(rootDirectory, commandExecutor)
val testFilePaths = findTestFile(repoRoot, filePath)
// return findTestFile(repoRoot, filePath)
val testTargets = bazelClient.retrieveBazelTargets(testFilePaths)
// val testTargets = bazelClient.retrieveBazelTargets(testFilePaths)

for (testTarget in testTargets) {
val coverageData = RunCoverageForTestTarget(
Expand All @@ -100,17 +96,6 @@ class RunCoverage(
coverageDataList.add(coverageData)
}
return coverageDataList

//this works
/*val covdat = RunCoverageForTestTarget(
rootDirectory,
"//coverage/test/java/com/example:test",
commandExecutor,
scriptBgDispatcher
).runCoverage()
coverageDataList.add(covdat!!)
return coverageDataList*/
// return covdat
}

fun findTestFile(repoRoot: String, filePath: String): List<String> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,28 +222,6 @@ class RunCoverageTest {
longCommandExecutor,
scriptBgDispatcher).execute()

/*val expectedResult =
"["+"SF:coverage/main/java/com/example/TwoSum.kt\n" +
"FN:7,com/example/TwoSum${'$'}Companion::sumNumbers (II)Ljava/lang/Object;\n" +
"FN:3,com/example/TwoSum::<init> ()V\n" +
"FNDA:1,com/example/TwoSum${'$'}Companion::sumNumbers (II)Ljava/lang/Object;\n" +
"FNDA:0,com/example/TwoSum::<init> ()V\n" +
"FNF:2\n" +
"FNH:1\n" +
"BRDA:7,0,0,1\n" +
"BRDA:7,0,1,1\n" +
"BRDA:7,0,2,1\n" +
"BRDA:7,0,3,1\n" +
"BRF:4\n" +
"BRH:4\n" +
"DA:3,0\n" +
"DA:7,1\n" +
"DA:8,1\n" +
"DA:10,1\n" +
"LH:3\n" +
"LF:4\n" +
"end_of_record\n"+"]"*/

val expectedResultList = listOf(
"SF:coverage/main/java/com/example/TwoSum.kt\n"+
"FN:7,com/example/TwoSum${'$'}Companion::sumNumbers (II)Ljava/lang/Object;\n"+
Expand Down Expand Up @@ -275,13 +253,4 @@ class RunCoverageTest {
scriptBgDispatcher, processTimeout = 5, processTimeoutUnit = TimeUnit.MINUTES
)
}

/** Runs the run_coverage. */
private fun runScript(filePath: String) {
RunCoverage(
"${tempFolder.root}",
filePath,
commandExecutor,
scriptBgDispatcher).execute()
}
}

0 comments on commit 8e28f1d

Please sign in to comment.