Skip to content

Commit

Permalink
rework report generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tagantroy committed Jul 17, 2018
1 parent ab0f57a commit d1b8535
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,13 @@ class QueueActor(configuration: Configuration,
private suspend fun onBatchCompleted(device: Device, results: TestBatchResults) {
val finished = results.finished
val failed = results.failed
val notExecuted = results.notExecuted
logger.debug { "handle test results ${device.serialNumber}" }
if (finished.isNotEmpty()) {
handleFinishedTests(finished, device)
}
if (failed.isNotEmpty()) {
handleFailedTests(failed, device)
}
if (notExecuted.isNotEmpty()) {
returnTests(notExecuted)
}
activeBatches.remove(device)
onRequestBatch(device)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ import com.malinskiy.marathon.test.Test

data class TestBatchResults(val device: Device,
val finished: Collection<TestResult>,
val failed: Collection<TestResult>,
val notExecuted: Collection<Test>)
val failed: Collection<TestResult>)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.malinskiy.marathon.execution.TestBatchResults
import com.malinskiy.marathon.test.Test
import com.malinskiy.marathon.test.TestBatch
import com.malinskiy.marathon.execution.TestResult
import com.malinskiy.marathon.execution.TestStatus
import kotlinx.coroutines.experimental.CompletableDeferred
import com.android.ddmlib.testrunner.TestRunResult as DdmLibTestRunResult
import com.android.ddmlib.testrunner.TestResult as DdmLibTestResult
Expand All @@ -34,9 +35,11 @@ class TestRunResultsListener(private val testBatch: TestBatch,

val notExecuted = tests.filterNot {
results.containsKey(it.key)
}.values
}.values.map {
TestResult(it, device.toDeviceInfo(), TestStatus.INCOMPLETE, 0, 0, null)
}

deferred.complete(TestBatchResults(device, finished, failed, notExecuted))
deferred.complete(TestBatchResults(device, finished, failed + notExecuted))
}

fun Map.Entry<TestIdentifier, DdmLibTestResult>.toTestResult(device: Device): TestResult {
Expand Down

0 comments on commit d1b8535

Please sign in to comment.