diff --git a/test_runner/src/main/kotlin/ftl/domain/testmatrix/UpdateTestMatrix.kt b/test_runner/src/main/kotlin/ftl/domain/testmatrix/UpdateTestMatrix.kt index cf147c3637..f701753c1d 100644 --- a/test_runner/src/main/kotlin/ftl/domain/testmatrix/UpdateTestMatrix.kt +++ b/test_runner/src/main/kotlin/ftl/domain/testmatrix/UpdateTestMatrix.kt @@ -45,7 +45,8 @@ private fun TestMatrix.Data.updateProperties(newMatrix: TestMatrix.Data) = copy( testFileName = newMatrix.testFileName, isCompleted = MatrixState.completed(state) && newMatrix.testExecutions.all { MatrixState.completed(it.state) }, - testExecutions = newMatrix.testExecutions + testExecutions = newMatrix.testExecutions, + isRoboTest = newMatrix.isRoboTest, ) private fun TestMatrix.Data.updateBillableMinutes(billableMinutes: TestMatrix.BillableMinutes) = copy( diff --git a/test_runner/src/test/kotlin/ftl/api/TestMatrixTest.kt b/test_runner/src/test/kotlin/ftl/api/TestMatrixTest.kt index f76f15e139..2278c37773 100644 --- a/test_runner/src/test/kotlin/ftl/api/TestMatrixTest.kt +++ b/test_runner/src/test/kotlin/ftl/api/TestMatrixTest.kt @@ -318,6 +318,30 @@ class TestMatrixTest { val updatedMatrix = testMatrix.updateWithMatrix(ftlTestMatrix.toApiModel()) assertEquals("N/A", updatedMatrix.appFileName) } + + @Test + fun `isRoboTest property should update to true for Robo Test matrices`() { + val testExecutions = listOf( + createStepExecution(1, "shamu"), + createStepExecution(1, "NexusLowRes") + ) + + val matrixId = "123" + val ftlTestMatrix = ftlTestMatrix() + ftlTestMatrix.testMatrixId = matrixId + ftlTestMatrix.state = PENDING + ftlTestMatrix.resultStorage = createResultsStorage() + ftlTestMatrix.testExecutions = testExecutions + + var testMatrix = ftlTestMatrix.toApiModel() + assert(!testMatrix.isRoboTest) + + val newTestMatrix = ftlTestMatrix.toApiModel().copy(isRoboTest = true) + testMatrix = testMatrix.copy(state = FINISHED) + testMatrix = testMatrix.updateWithMatrix(newTestMatrix) + + assert(testMatrix.isRoboTest) { "isRoboTest was not updated" } + } } private inline fun ref(path: () -> String) = FileReference().apply { gcsPath = path() }