Skip to content
Snippets Groups Projects
Commit c1ce4104 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

merge upstream master

parents 45aef13a f7e2b939
No related branches found
No related tags found
1 merge request!171Introduce ResourceSets to make loading of resource files more flexible
...@@ -35,7 +35,8 @@ class StateHandlerTest { ...@@ -35,7 +35,8 @@ class StateHandlerTest {
fun namespacedTest() { fun namespacedTest() {
val handler = ExecutionStateHandler(client = server.client) val handler = ExecutionStateHandler(client = server.client)
handler.getExecutionState("example-execution") handler.getExecutionState("example-execution")
assert(server assert(
server
.lastRequest .lastRequest
.toString() .toString()
.contains("namespaces") .contains("namespaces")
......
package theodolite.patcher
import io.quarkus.test.junit.QuarkusTest
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark
import theodolite.execution.operator.BenchmarkCRDummy
import theodolite.execution.operator.ExecutionCRDummy
@QuarkusTest
class ConfigOverrideModifierTest {
private var execution = BenchmarkExecution()
private var benchmark = KubernetesBenchmark()
@BeforeEach
fun setup() {
val execution1 = ExecutionCRDummy(name = "matching-execution", benchmark = "Test-Benchmark")
val benchmark1 = BenchmarkCRDummy(name = "Test-Benchmark")
this.execution = execution1.getCR().spec
this.benchmark = benchmark1.getCR().spec
}
@Test
fun setAdditionalLabelsTest() {
val modifier = ConfigOverrideModifier(
execution = this.execution,
resources = listOf("test-resource.yaml")
)
modifier.setAdditionalLabels(
labelName = "test-name",
labelValue = "test-value"
)
Assertions.assertEquals(
"test-name",
this.execution
.configOverrides.firstOrNull()
?.patcher
?.properties
?.get("variableName")
)
Assertions.assertEquals(
"test-value",
this.execution
.configOverrides.firstOrNull()
?.value
)
}
}
\ No newline at end of file
package theodolite.util
import io.quarkus.test.junit.QuarkusTest
import org.junit.Rule
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import theodolite.execution.operator.ExecutionCRDummy
import theodolite.model.crd.ExecutionCRD
import theodolite.model.crd.States
@QuarkusTest
class ExecutionStateComparatorTest {
@Test
fun testCompare() {
val comparator = ExecutionStateComparator(States.RESTART)
val execution1 = ExecutionCRDummy("dummy1", "default-benchmark")
val execution2 = ExecutionCRDummy("dummy2", "default-benchmark")
execution1.getStatus().executionState = States.RESTART.value
execution2.getStatus().executionState = States.PENDING.value
val list = listOf(execution2.getCR(), execution1.getCR())
assertEquals(
list.reversed(),
list.sortedWith(comparator)
)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment