chore: fix benchmark (#1698)
This was out of date. I've updated it to use the correct format, and update the asserts accordingly. Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
This commit is contained in:
parent
e8fd680860
commit
5e2d7d7176
|
|
@ -20,4 +20,7 @@ site
|
|||
.cache/
|
||||
|
||||
# coverage results
|
||||
*coverage.out
|
||||
*coverage.out
|
||||
|
||||
# benchmark results
|
||||
benchmark.txt
|
||||
2
Makefile
2
Makefile
|
|
@ -49,6 +49,8 @@ test-flagd-proxy:
|
|||
go test -race -covermode=atomic -cover -short ./flagd-proxy/pkg/... -coverprofile=flagd-proxy-coverage.out
|
||||
flagd-integration-test: # dependent on ./bin/flagd start -f file:test-harness/flags/testing-flags.json -f file:test-harness/flags/custom-ops.json -f file:test-harness/flags/evaluator-refs.json -f file:test-harness/flags/zero-flags.json
|
||||
go test -cover ./test/integration $(ARGS)
|
||||
flagd-benchmark-test:
|
||||
go test -bench=Bench -short -benchtime=5s -benchmem ./core/... | tee benchmark.txt
|
||||
run: # default to flagd
|
||||
make run-flagd
|
||||
run-flagd:
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ func BenchmarkFractionalEvaluation(b *testing.B) {
|
|||
},
|
||||
{
|
||||
"fractional": [
|
||||
"email",
|
||||
{"var": "email"},
|
||||
[
|
||||
"red",
|
||||
25
|
||||
|
|
@ -542,41 +542,41 @@ func BenchmarkFractionalEvaluation(b *testing.B) {
|
|||
expectedReason string
|
||||
expectedErrorCode string
|
||||
}{
|
||||
"test@faas.com": {
|
||||
"test_a@faas.com": {
|
||||
flags: flags,
|
||||
flagKey: "headerColor",
|
||||
context: map[string]any{
|
||||
"email": "test@faas.com",
|
||||
"email": "test_a@faas.com",
|
||||
},
|
||||
expectedVariant: "blue",
|
||||
expectedValue: "#0000FF",
|
||||
expectedReason: model.TargetingMatchReason,
|
||||
},
|
||||
"test_b@faas.com": {
|
||||
flags: flags,
|
||||
flagKey: "headerColor",
|
||||
context: map[string]any{
|
||||
"email": "test_b@faas.com",
|
||||
},
|
||||
expectedVariant: "red",
|
||||
expectedValue: "#FF0000",
|
||||
expectedReason: model.TargetingMatchReason,
|
||||
},
|
||||
"test2@faas.com": {
|
||||
"test_c@faas.com": {
|
||||
flags: flags,
|
||||
flagKey: "headerColor",
|
||||
context: map[string]any{
|
||||
"email": "test2@faas.com",
|
||||
"email": "test_c@faas.com",
|
||||
},
|
||||
expectedVariant: "yellow",
|
||||
expectedValue: "#FFFF00",
|
||||
expectedVariant: "green",
|
||||
expectedValue: "#00FF00",
|
||||
expectedReason: model.TargetingMatchReason,
|
||||
},
|
||||
"test3@faas.com": {
|
||||
"test_d@faas.com": {
|
||||
flags: flags,
|
||||
flagKey: "headerColor",
|
||||
context: map[string]any{
|
||||
"email": "test3@faas.com",
|
||||
},
|
||||
expectedVariant: "red",
|
||||
expectedValue: "#FF0000",
|
||||
expectedReason: model.TargetingMatchReason,
|
||||
},
|
||||
"test4@faas.com": {
|
||||
flags: flags,
|
||||
flagKey: "headerColor",
|
||||
context: map[string]any{
|
||||
"email": "test4@faas.com",
|
||||
"email": "test_d@faas.com",
|
||||
},
|
||||
expectedVariant: "blue",
|
||||
expectedValue: "#0000FF",
|
||||
|
|
|
|||
Loading…
Reference in New Issue