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

fix test

parent aaee7cab
No related branches found
No related tags found
1 merge request!176Add a Benchmark Status
...@@ -191,9 +191,9 @@ class TheodoliteController( ...@@ -191,9 +191,9 @@ class TheodoliteController(
private fun checkResource(benchmark: KubernetesBenchmark): States { private fun checkResource(benchmark: KubernetesBenchmark): States {
return try { return try {
val appResources = val appResources =
benchmark.loadKubernetesResources(resources = benchmark.appResource) benchmark.loadKubernetesResources(resourceSet = benchmark.appResourceSets)
val loadGenResources = val loadGenResources =
benchmark.loadKubernetesResources(resources = benchmark.loadGenResource) benchmark.loadKubernetesResources(resourceSet = benchmark.loadGenResourceSets)
if(appResources.isNotEmpty() && loadGenResources.isNotEmpty()) { if(appResources.isNotEmpty() && loadGenResources.isNotEmpty()) {
States.AVAILABLE States.AVAILABLE
} else { } else {
......
...@@ -15,6 +15,8 @@ import theodolite.benchmark.BenchmarkExecution ...@@ -15,6 +15,8 @@ import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark import theodolite.benchmark.KubernetesBenchmark
import theodolite.model.crd.BenchmarkCRD import theodolite.model.crd.BenchmarkCRD
import theodolite.model.crd.ExecutionCRD import theodolite.model.crd.ExecutionCRD
import theodolite.model.crd.ExecutionStatus
import theodolite.model.crd.States
@QuarkusTest @QuarkusTest
class ControllerTest { class ControllerTest {
...@@ -40,6 +42,7 @@ class ControllerTest { ...@@ -40,6 +42,7 @@ class ControllerTest {
// benchmark // benchmark
val benchmark1 = BenchmarkCRDummy(name = "Test-Benchmark") val benchmark1 = BenchmarkCRDummy(name = "Test-Benchmark")
benchmark1.getCR().status.resourceSets = States.AVAILABLE.value
val benchmark2 = BenchmarkCRDummy(name = "Test-Benchmark-123") val benchmark2 = BenchmarkCRDummy(name = "Test-Benchmark-123")
benchmarkResourceList.items = listOf(benchmark1.getCR(), benchmark2.getCR()) benchmarkResourceList.items = listOf(benchmark1.getCR(), benchmark2.getCR())
...@@ -113,12 +116,12 @@ class ControllerTest { ...@@ -113,12 +116,12 @@ class ControllerTest {
.getDeclaredMethod("getBenchmarks") .getDeclaredMethod("getBenchmarks")
method.isAccessible = true method.isAccessible = true
val result = method.invoke(controller) as List<KubernetesBenchmark> val result = method.invoke(controller) as List<BenchmarkCRD>
assertEquals(2, result.size) assertEquals(2, result.size)
assertEquals( assertEquals(
gson.toJson(benchmark), gson.toJson(benchmark),
gson.toJson(result.firstOrNull()) gson.toJson(result.firstOrNull()?.spec)
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment