Skip to content
Snippets Groups Projects
Commit 587af04f authored by Benedikt Wetzel's avatar Benedikt Wetzel Committed by Lorenz Boguhn
Browse files

fix missing slo in CompositeTest

parent e8e85e65
Branches
Tags
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!92Introduce experiment evaluation,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -3,6 +3,7 @@ package theodolite ...@@ -3,6 +3,7 @@ package theodolite
import io.quarkus.test.junit.QuarkusTest import io.quarkus.test.junit.QuarkusTest
import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import theodolite.benchmark.BenchmarkExecution
import theodolite.strategies.restriction.LowerBoundRestriction import theodolite.strategies.restriction.LowerBoundRestriction
import theodolite.strategies.searchstrategy.BinarySearch import theodolite.strategies.searchstrategy.BinarySearch
import theodolite.strategies.searchstrategy.CompositeStrategy import theodolite.strategies.searchstrategy.CompositeStrategy
...@@ -29,7 +30,8 @@ class CompositeStrategyTest { ...@@ -29,7 +30,8 @@ class CompositeStrategyTest {
val mockResources: List<Resource> = (0..6).map { number -> Resource(number, "Instances") } val mockResources: List<Resource> = (0..6).map { number -> Resource(number, "Instances") }
val results = Results() val results = Results()
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results) val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker)
val linearSearch = LinearSearch(benchmarkExecutor) val linearSearch = LinearSearch(benchmarkExecutor)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
...@@ -61,8 +63,9 @@ class CompositeStrategyTest { ...@@ -61,8 +63,9 @@ class CompositeStrategyTest {
val mockResources: List<Resource> = (0..6).map { number -> Resource(number, "Instances") } val mockResources: List<Resource> = (0..6).map { number -> Resource(number, "Instances") }
val results = Results() val results = Results()
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutorImpl = val benchmarkExecutorImpl =
TestBenchmarkExecutorImpl(mockResults, benchmark, results) TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker)
val binarySearch = BinarySearch(benchmarkExecutorImpl) val binarySearch = BinarySearch(benchmarkExecutorImpl)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
...@@ -94,7 +97,8 @@ class CompositeStrategyTest { ...@@ -94,7 +97,8 @@ class CompositeStrategyTest {
val mockResources: List<Resource> = (0..7).map { number -> Resource(number, "Instances") } val mockResources: List<Resource> = (0..7).map { number -> Resource(number, "Instances") }
val results = Results() val results = Results()
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results) val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker)
val binarySearch = BinarySearch(benchmarkExecutor) val binarySearch = BinarySearch(benchmarkExecutor)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
......
package theodolite package theodolite
import theodolite.benchmark.Benchmark import theodolite.benchmark.Benchmark
import theodolite.benchmark.BenchmarkExecution
import theodolite.execution.BenchmarkExecutor import theodolite.execution.BenchmarkExecutor
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
import theodolite.util.Resource import theodolite.util.Resource
...@@ -10,16 +11,19 @@ import java.time.Duration ...@@ -10,16 +11,19 @@ import java.time.Duration
class TestBenchmarkExecutorImpl( class TestBenchmarkExecutorImpl(
private val mockResults: Array<Array<Boolean>>, private val mockResults: Array<Array<Boolean>>,
benchmark: Benchmark, benchmark: Benchmark,
results: Results results: Results,
slo: BenchmarkExecution.Slo
) : ) :
BenchmarkExecutor( BenchmarkExecutor(
benchmark, results, executionDuration = Duration.ofSeconds(1), benchmark,
configurationOverrides = emptyList() results,
executionDuration = Duration.ofSeconds(1),
configurationOverrides = emptyList(),
slo = slo
) { ) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
val result = this.mockResults[load.get()][res.get()] val result = this.mockResults[load.get()][res.get()]
this.results.setResult(Pair(load, res), result) this.results.setResult(Pair(load, res), result)
return result return result
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment