Skip to content

Commit

Permalink
Updated CoverageRunnerTest after sequential flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Rd4dev committed Jul 28, 2024
1 parent 5479330 commit 24390f5
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ class CoverageRunnerTest {
@Test
fun testRunWithCoverageAsync_emptyDirectory_throwsException() {
val exception = assertThrows<IllegalStateException>() {
runBlocking {
coverageRunner.runWithCoverageAsync(bazelTestTarget).await()
}
coverageRunner.runWithCoverageAsync(bazelTestTarget)
}

assertThat(exception).hasMessageThat().contains("not invoked from within a workspace")
Expand All @@ -97,9 +95,7 @@ class CoverageRunnerTest {
testBazelWorkspace.initEmptyWorkspace()

val exception = assertThrows<IllegalStateException>() {
runBlocking {
coverageRunner.runWithCoverageAsync(bazelTestTarget).await()
}
coverageRunner.runWithCoverageAsync(bazelTestTarget)
}

assertThat(exception).hasMessageThat().contains("Expected non-zero exit code")
Expand All @@ -125,7 +121,6 @@ class CoverageRunnerTest {
runBlocking {
launch {
coverageRunner.runWithCoverageAsync("//coverage/test/java/com/example:AddNumsTest")
.await()
}

launch {
Expand Down Expand Up @@ -162,7 +157,6 @@ class CoverageRunnerTest {
runBlocking {
launch {
coverageRunner.runWithCoverageAsync("//coverage/test/java/com/example:AddNumsTest")
.await()
}

launch {
Expand Down Expand Up @@ -192,11 +186,9 @@ class CoverageRunnerTest {
testSubpackage = "coverage/test/java/com/example"
)

val result = runBlocking {
coverageRunner.runWithCoverageAsync(
val result = coverageRunner.runWithCoverageAsync(
"//coverage/test/java/com/example:AddNumsTest"
).await()
}
)

val expectedResult = CoverageReport.newBuilder()
.setBazelTestTarget("//coverage/test/java/com/example:AddNumsTest")
Expand Down

0 comments on commit 24390f5

Please sign in to comment.