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

Function TestDedicatedColumnsToJson

pkg/api/dedicated_columns_to_json_test.go:13–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestDedicatedColumnsToJson(t *testing.T) {
14 d := NewDedicatedColumnsToJSON()
15
16 testCols := []backend.DedicatedColumns{}
17 for i := 0; i < 10; i++ {
18 testCols = append(testCols, randoDedicatedCols())
19 }
20
21 // do all test cols 2x to test caching
22 for i := 0; i < 2; i++ {
23 for _, cols := range testCols {
24 expectedJSON := dedicatedColsToJSON(t, cols)
25 actualJSON, err := d.JSONForDedicatedColumns(cols)
26 require.NoError(t, err)
27
28 require.Equal(t, expectedJSON, actualJSON, "iteration %d, cols: %v", i, cols)
29 }
30 }
31}
32
33func dedicatedColsToJSON(t *testing.T, cols backend.DedicatedColumns) string {
34 t.Helper()

Callers

nothing calls this directly

Calls 5

randoDedicatedColsFunction · 0.85
dedicatedColsToJSONFunction · 0.85
EqualMethod · 0.45

Tested by

no test coverage detected