MCPcopy
hub / github.com/grafana/tempo / Test_overridesValidator

Function Test_overridesValidator

cmd/tempo/app/overrides_validation_test.go:267–843  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

265}
266
267func Test_overridesValidator(t *testing.T) {
268 testCases := []struct {
269 name string
270 cfg Config
271 limits client.Limits
272 expErr string
273 }{
274 {
275 name: "forwarders - valid",
276 cfg: Config{
277 Distributor: distributor.Config{
278 Forwarders: []forwarder.Config{
279 {Name: "forwarder-1"},
280 {Name: "forwarder-2"},
281 {Name: "forwarder-3"},
282 },
283 },
284 },
285 limits: client.Limits{
286 Forwarders: &[]string{"forwarder-1", "forwarder-3"},
287 },
288 },
289 {
290 name: "forwarders - invalid",
291 cfg: Config{
292 Distributor: distributor.Config{
293 Forwarders: []forwarder.Config{
294 {Name: "forwarder-1"},
295 {Name: "forwarder-2"},
296 },
297 },
298 },
299 limits: client.Limits{
300 Forwarders: &[]string{"forwarder-1", "some-forwarder"},
301 },
302 expErr: "forwarder \"some-forwarder\" is not a known forwarder, contact your system administrator",
303 },
304 {
305 name: "metrics_generator.processor",
306 cfg: Config{},
307 limits: client.Limits{
308 MetricsGenerator: client.LimitsMetricsGenerator{
309 Processors: &listtomap.ListToMap{
310 "service-graphs": {},
311 "span-span": {},
312 },
313 },
314 },
315 expErr: fmt.Sprintf("metrics_generator.processor \"span-span\" is not a known processor, valid values: %v", validation.SupportedProcessors),
316 },
317 {
318 name: "filter policies",
319 cfg: Config{},
320 limits: client.Limits{
321 Forwarders: &[]string{},
322 MetricsGenerator: client.LimitsMetricsGenerator{Processor: client.LimitsMetricsGeneratorProcessor{SpanMetrics: client.LimitsMetricsGeneratorProcessorSpanMetrics{FilterPolicies: &[]filterconfig.FilterPolicy{{
323 Include: &filterconfig.PolicyMatch{
324 MatchType: filterconfig.Strict,

Callers

nothing calls this directly

Calls 9

float64PtrFunction · 0.85
boolMapPtrFunction · 0.85
histogramMethodPtrFunction · 0.85
newOverridesValidatorFunction · 0.85
strPtrFunction · 0.70
strArrPtrFunction · 0.70
dimensionMappingsPtrFunction · 0.70
ValidateMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected