Skip to content

Commit 1a448bf

Browse files
committed
Improve test assertions for command and envFrom attributes in WorkflowBuildersTests
1 parent 7f064d4 commit 1a448bf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

run/src/main/kotlin/com/cosmotech/run/workflow/argo/RunArgoWorkflowService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ internal class RunArgoWorkflowService(
211211
null,
212212
null,
213213
null,
214+
null,
215+
null,
214216
null)
215217
.items
216218
}

run/src/test/kotlin/com/cosmotech/run/workflow/argo/WorkflowBuildersTests.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import kotlin.test.Test
2020
import org.junit.jupiter.api.Assertions.assertEquals
2121
import org.junit.jupiter.api.Assertions.assertNotNull
2222
import org.junit.jupiter.api.Assertions.assertNull
23+
import org.junit.jupiter.api.Assertions.assertTrue
2324

2425
private const val DEFAULT_ENTRY_POINT = "entrypoint.py"
2526
private const val csmSimulationId = "simulationrunid"
@@ -109,15 +110,17 @@ class WorkflowBuildersTests {
109110
fun `Template has simulator no entrypoint`() {
110111
val src = getRunContainer()
111112
val template = buildTemplate(ORGANIZATION_ID, WORKSPACE_ID, src, csmPlatformProperties)
112-
assertNull(template.container?.command)
113+
assertNotNull(template.container?.command)
114+
assertTrue(template.container?.command?.isEmpty() == true)
113115
}
114116

115117
@Test
116118
fun `Template has default entrypoint if not defined`() {
117119
val src = getRunContainer()
118120
val template = buildTemplate(ORGANIZATION_ID, WORKSPACE_ID, src, csmPlatformProperties)
119121
val expected: String? = null
120-
assertEquals(expected, template.container?.command)
122+
assertNotNull(template.container?.command)
123+
assertTrue(template.container?.command?.isEmpty() == true)
121124
}
122125

123126
@Test
@@ -511,7 +514,7 @@ class WorkflowBuildersTests {
511514
val src = getRunContainer()
512515
val template = buildTemplate(ORGANIZATION_ID, null, src, csmPlatformProperties, true)
513516
assertNotNull(template.container)
514-
assertNull(template.container!!.envFrom)
517+
assertTrue(template.container?.envFrom?.isEmpty() == true)
515518
}
516519

517520
private fun getRunContainer(name: String = "default"): RunContainer {

0 commit comments

Comments
 (0)