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

Function TestDedicatedColumns_Validate

tempodb/backend/block_meta_test.go:415–661  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

413}
414
415func TestDedicatedColumns_Validate(t *testing.T) {
416 testCases := []struct {
417 name string
418 cols DedicatedColumns
419 isValid bool
420 expectedWarnings []error
421 }{
422 {name: "nil", isValid: true},
423 {name: "empty", cols: DedicatedColumns{}, isValid: true},
424 {
425 name: "minimal valid",
426 cols: DedicatedColumns{
427 {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString},
428 },
429 isValid: true,
430 },
431 {
432 name: "array option",
433 cols: DedicatedColumns{
434 {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionArray}},
435 },
436 isValid: true,
437 },
438 {
439 name: "blob option",
440 cols: DedicatedColumns{
441 {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionBlob}},
442 },
443 isValid: true,
444 },
445 {
446 name: "all options",
447 cols: DedicatedColumns{
448 {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString, Options: DedicatedColumnOptions{DedicatedColumnOptionArray, DedicatedColumnOptionBlob}},
449 },
450 isValid: true,
451 },
452 {
453 name: "all valid scopes and types",
454 cols: DedicatedColumns{
455 {Name: "test.span.str", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeString},
456 {Name: "test.span.int", Scope: DedicatedColumnScopeSpan, Type: DedicatedColumnTypeInt},
457 {Name: "test.res.str", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
458 {Name: "test.res.int", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeInt},
459 },
460 isValid: true,
461 },
462 {
463 name: "maximum allowed columns",
464 cols: DedicatedColumns{
465 {Name: "test.res.str-01", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
466 {Name: "test.res.str-02", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
467 {Name: "test.res.str-03", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
468 {Name: "test.res.str-04", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
469 {Name: "test.res.str-05", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
470 {Name: "test.res.str-06", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
471 {Name: "test.res.str-07", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},
472 {Name: "test.res.str-08", Scope: DedicatedColumnScopeResource, Type: DedicatedColumnTypeString},

Callers

nothing calls this directly

Calls 5

DedicatedColumnOptionTypeAlias · 0.85
ValidateMethod · 0.65
ErrorMethod · 0.65
RunMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected