(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestEncodings(t *testing.T) { |
| 15 | const repeatedSearchCount = 10 |
| 16 | |
| 17 | for _, enc := range encoding.AllEncodingsForWrites() { |
| 18 | t.Run(enc.Version(), func(t *testing.T) { |
| 19 | util.RunIntegrationTests(t, util.TestHarnessConfig{ |
| 20 | ConfigOverlay: "./config-encodings.yaml", |
| 21 | ConfigTemplateData: map[string]any{ |
| 22 | "Version": enc.Version(), |
| 23 | }, |
| 24 | Components: util.ComponentsBackendQuerying | util.ComponentsRecentDataQuerying, |
| 25 | }, func(h *util.TempoHarness) { |
| 26 | h.WaitTracesWritable(t) |
| 27 | |
| 28 | info := tempoUtil.NewTraceInfo(time.Now(), "") |
| 29 | require.NoError(t, h.WriteTraceInfo(info, "")) |
| 30 | |
| 31 | h.WaitTracesQueryable(t, 1) |
| 32 | |
| 33 | apiClient := h.APIClientHTTP("") |
| 34 | util.QueryAndAssertTrace(t, apiClient, info) |
| 35 | |
| 36 | // search for trace in backend multiple times with different attributes to make sure |
| 37 | // we search with different scopes and with attributes from dedicated columns |
| 38 | for range repeatedSearchCount { |
| 39 | util.SearchTraceQLAndAssertTrace(t, apiClient, info) |
| 40 | } |
| 41 | |
| 42 | h.WaitTracesWrittenToBackend(t, 1) |
| 43 | h.ForceBackendQuerying(t) |
| 44 | |
| 45 | apiClient = h.APIClientHTTP("") |
| 46 | grpcClient, ctx, err := h.APIClientGRPC("") |
| 47 | require.NoError(t, err) |
| 48 | |
| 49 | now := time.Now() |
| 50 | for range repeatedSearchCount { |
| 51 | // search the backend. this works b/c we're passing a start/end AND setting query ingesters within min/max to 0 |
| 52 | util.SearchTraceQLAndAssertTraceWithRange(t, apiClient, info, now.Add(-time.Hour).Unix(), now.Unix()) |
| 53 | // find the trace with streaming. using the http server b/c that's what Grafana will do |
| 54 | util.SearchStreamAndAssertTrace(t, ctx, grpcClient, info, now.Add(-time.Hour).Unix(), now.Unix()) |
| 55 | } |
| 56 | }) |
| 57 | }) |
| 58 | } |
| 59 | } |
nothing calls this directly
no test coverage detected