File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
main/kotlin/dev/androidx/ci/testRunner
test/kotlin/dev/androidx/ci/testRunner Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,16 @@ internal class TestExecutionStore(
4646 suspend fun getTestExecutionSteps (
4747 testMatrix : TestMatrix
4848 ): List <Step > {
49- return getTestExecutionSteps(
50- projectId = testMatrix.projectId!! ,
51- historyId = testMatrix.resultStorage.toolResultsExecution?.historyId!! ,
52- executionId = testMatrix.resultStorage.toolResultsExecution.executionId!!
53- )
49+ return testMatrix.projectId?.let { projectId ->
50+ testMatrix.resultStorage.toolResultsExecution?.historyId?.let { historyId ->
51+ testMatrix.resultStorage.toolResultsExecution.executionId?.let { executionId ->
52+ getTestExecutionSteps(
53+ projectId = projectId,
54+ historyId = historyId,
55+ executionId = executionId
56+ )
57+ }
58+ }
59+ } ? : emptyList()
5460 }
5561}
Original file line number Diff line number Diff line change @@ -81,4 +81,24 @@ internal class TestExecutionStoreTest {
8181 assertThat(outputSteps).hasSize(2 )
8282 assertThat(outputSteps).containsExactlyElementsIn(inputSteps)
8383 }
84+
85+ @Test
86+ fun getExecutionStepsNullValuesForExecutionIdHistoryId () = runBlocking<Unit > {
87+ val resultPath = " ${fakeBackend.fakeGoogleCloudApi.rootGcsPath} /my-test-matrix-results"
88+ val testMatrix = fakeBackend.fakeFirebaseTestLabApi.createTestMatrix(
89+ projectId = fakeBackend.firebaseProjectId,
90+ requestId = " requestId" ,
91+ testMatrix = TestMatrix (
92+ resultStorage = ResultStorage (
93+ googleCloudStorage = GoogleCloudStorage (resultPath)
94+ ),
95+ projectId = fakeBackend.firebaseProjectId,
96+ environmentMatrix = EnvironmentMatrix (),
97+ testSpecification = TestSpecification ()
98+ )
99+ )
100+
101+ val outputSteps = testExecutionStore.getTestExecutionSteps(testMatrix)
102+ assertThat(outputSteps).isEmpty()
103+ }
84104}
You can’t perform that action at this time.
0 commit comments