Skip to content

Commit

Permalink
Renamed fixture files, updated expected sampling probabilities to avo…
Browse files Browse the repository at this point in the history
…id being treated as empty during marshaling/unmarshaling

Signed-off-by: Kazimieras Pociunas <kazimieras.pociunas@gmail.com>
  • Loading branch information
kuujis committed Mar 19, 2024
1 parent 19a9c60 commit cd75115
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"perOperationStrategies": [
{
"operation": "/health",
"probabilisticSampling": {}
"probabilisticSampling": {
"samplingRate": 0.1
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"perOperationStrategies": [
{
"operation": "/health",
"probabilisticSampling": {}
"probabilisticSampling": {
"samplingRate": 0.1
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
"operation": "/health",
"type": "probabilistic",
"param": 0.0
"param": 0.1
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/sampling/strategystore/static/strategy_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ func TestServiceNoPerOperationStrategies(t *testing.T) {

// expected response for ServiceA (which has probablistic service level sampling strategy)
// shall contain /health operation with default service level sampling strategy as well
expectedServiceAResponse, errServiceA := makeServiceStrategyResponseFromFile("fixtures/probablistic_with_default_operation_strategy.json")
expectedServiceAResponse, errServiceA := makeServiceStrategyResponseFromFile("fixtures/TestServiceNoPerOperationStrategies_response_for_ServiceA.json")
require.NoError(t, errServiceA)

strategy, err := store.GetSamplingStrategy(context.Background(), "ServiceA")
Expand All @@ -483,8 +483,8 @@ func TestServiceNoPerOperationStrategies(t *testing.T) {
assert.Equal(t, expectedServiceAResponse, strategy)

// expected response for ServiceB (which has ratelimiting service level sampling strategy)
// shall contain /health operation with sampling probability taken from defaul operation level strategy
expectedServiceBResponse, errServiceB := makeServiceStrategyResponseFromFile("fixtures/ratelimiting_with_default_operation_strategy.json")
// shall contain /health operation with sampling probability taken from default operation level strategy
expectedServiceBResponse, errServiceB := makeServiceStrategyResponseFromFile("fixtures/TestServiceNoPerOperationStrategies_response_for_ServiceB.json")
require.NoError(t, errServiceB)

strategy, err = store.GetSamplingStrategy(context.Background(), "ServiceB")
Expand Down

0 comments on commit cd75115

Please sign in to comment.