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

Function TestCompression

integration/operations/compression_test.go:21–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

19)
20
21func TestCompression(t *testing.T) {
22 util.RunIntegrationTests(t, util.TestHarnessConfig{
23 DeploymentMode: util.DeploymentModeSingleBinary,
24 }, func(h *util.TempoHarness) {
25 h.WaitTracesWritable(t)
26
27 // Send a trace
28 info := tempoUtil.NewTraceInfo(time.Now(), "")
29 require.NoError(t, h.WriteTraceInfo(info, ""))
30
31 h.WaitTracesQueryable(t, 1)
32
33 // Create client with compression
34 apiClient := h.APIClientHTTP("")
35 util.QueryAndAssertTrace(t, apiClient, info)
36
37 // Query and assert trace with compression
38 apiClient.WithTransport(gzhttp.Transport(http.DefaultTransport))
39 queryAndAssertTraceCompression(t, apiClient, info)
40 })
41}
42
43func queryAndAssertTraceCompression(t *testing.T, client *httpclient.Client, info *tempoUtil.TraceInfo) {
44 // The received client will strip the header before we have a chance to inspect it, so just validate that the compressed client works as expected.

Callers

nothing calls this directly

Calls 7

WaitTracesWritableMethod · 0.80
WriteTraceInfoMethod · 0.80
WaitTracesQueryableMethod · 0.80
APIClientHTTPMethod · 0.80
NowMethod · 0.65
WithTransportMethod · 0.65

Tested by

no test coverage detected