diff --git a/theodolite/crd/crd-execution.yaml b/theodolite/crd/crd-execution.yaml index 3e87df678cf6e025b60d3c07dffee4d5f5511516..fc5a781340fb1d539ee8126edb761f428406e758 100644 --- a/theodolite/crd/crd-execution.yaml +++ b/theodolite/crd/crd-execution.yaml @@ -80,31 +80,37 @@ spec: execution: # def execution config description: Defines the overall parameter for the execution. type: object - required: ["strategy", "duration", "repetitions", "restrictions"] + required: ["strategy", "duration", "repetitions"] properties: metric: - default: "demand" type: string - oneOf: - - "demand" - - "capacity" + # default: "demand" + # oneOf: + # - "demand" + # - "capacity" strategy: description: Defines the used strategy for the execution, either 'LinearSearch', 'BinarySearch' or 'InitialGuessSearch' type: object - name: string + required: ["name"] properties: + name: + type: string + #properties: + # type: object restrictions: description: List of restriction strategies used to delimit the search space. type: array items: type: string - guessStrategy: string - searchStrategy: string + guessStrategy: + type: string + searchStrategy: + type: string duration: description: Defines the duration of each experiment in seconds. type: integer repetitions: - description: Numper of repititions for each experiments. + description: Number of repititions for each experiments. type: integer loadGenerationDelay: description: Seconds to wait between the start of the SUT and the load generator. diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt b/theodolite/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt index b5dd15623a288a79288603a91e91ee428b1e0916..838b74642d6c260c6a32102c401852833a88dcab 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/BenchmarkExecution.kt @@ -41,7 +41,7 @@ class BenchmarkExecution : KubernetesResource { @JsonDeserialize @RegisterForReflection class Execution : KubernetesResource { - lateinit var metric: String + var metric = "demand" //irgendwie mag er es nicht mit den default laden, wenn lateinit dann gibt es bei den tests fehler und muss bei var setzen lateinit var strategy: Strategy var duration by Delegates.notNull<Long>() var repetitions by Delegates.notNull<Int>() @@ -56,9 +56,9 @@ class BenchmarkExecution : KubernetesResource { @RegisterForReflection class Strategy : KubernetesResource { lateinit var name: String - lateinit var restrictions: List<String> - lateinit var guessStrategy: String - lateinit var searchStrategy: String + var restrictions = emptyList<String>() + var guessStrategy = "" + var searchStrategy = "" } /** diff --git a/theodolite/src/test/kotlin/theodolite/util/ResultsTest.kt b/theodolite/src/test/kotlin/theodolite/util/ResultsTest.kt index f3556d8072e25e90fe76500dfdc215ba17999751..cef83da3cdb342410cc99c07b6a949913ff1f61c 100644 --- a/theodolite/src/test/kotlin/theodolite/util/ResultsTest.kt +++ b/theodolite/src/test/kotlin/theodolite/util/ResultsTest.kt @@ -24,23 +24,6 @@ internal class ResultsTest { assertEquals(2, minRequiredInstances) } - @Test - @Disabled - // TODO necessary? - fun testMinRequiredInstancesWhenNotSuccessful() { - // This test is currently not implemented this way, but might later be the desired behavior. - val results = Results(Metric.from("demand")) - results.setResult(Pair(10000, 1), true) - results.setResult(Pair(10000, 2), true) - results.setResult(Pair(20000, 1), false) - results.setResult(Pair(20000, 2), false) - - val minRequiredInstances = results.getOptYDimensionValue(20000) - - assertNotNull(minRequiredInstances) - assertEquals(2, minRequiredInstances!!) - } - @Test fun testGetMaxBenchmarkedLoadWhenAllSuccessfulDemand() { val results = Results(Metric.from("demand")) diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml index 1407a9952b7454053d204454841d51cfb4d7dbf4..15f5f451a144312b1ef221be941a52a44626fca4 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml @@ -19,10 +19,11 @@ spec: offset: 0 warmup: 60 # in seconds execution: - strategy: "LinearSearch" + name: "RestrictionSearch" + restrictions: + - "LowerBound" + searchStrategy: "LinearSearch" duration: 300 # in seconds repetitions: 1 loadGenerationDelay: 30 # in seconds - restrictions: - - "LowerBound" configOverrides: [] diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml index c075702da218397352f1dc1e5b283534fbb4d718..37b83edbdf1300a1a9e6daff1a1f8b1324579e2c 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml @@ -20,10 +20,12 @@ spec: externalSloUrl: "http://localhost:80/evaluate-slope" warmup: 60 # in seconds execution: - strategy: "LinearSearch" + strategy: + name: "RestrictionSearch" + restrictions: + - "LowerBound" + searchStrategy: "LinearSearch" duration: 300 # in seconds repetitions: 1 loadGenerationDelay: 30 # in seconds - restrictions: - - "LowerBound" configOverrides: [] diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml index ee7a901c8047a9bfa873c8b4a15f4ce301653f59..aee12f5fd3d2e9763058ce273ea2836ed542f7c4 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml @@ -20,14 +20,12 @@ spec: externalSloUrl: "http://localhost:80/evaluate-slope" warmup: 60 # in seconds execution: - metric: "demand" - strategy: "RestrictionSearch" - properties: - restrictions: - - "LowerBound" - searchStrategy: "LinearSearch" + strategy: + name: "RestrictionSearch" + restrictions: + - "LowerBound" + searchStrategy: "LinearSearch" duration: 300 # in seconds repetitions: 1 loadGenerationDelay: 30 # in seconds - configOverrides: []