Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Jun 16, 2024
1 parent 80f15c6 commit 0647b51
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pkg/clientcfg/clientcfghttp/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (
)

type testServer struct {
metricsFactory *metricstest.Factory
samplingStore *mockSamplingProvider
bgMgr *mockBaggageMgr
server *httptest.Server
handler *HTTPHandler
metricsFactory *metricstest.Factory
samplingProvider *mockSamplingProvider
bgMgr *mockBaggageMgr
server *httptest.Server
handler *HTTPHandler
}

func withServer(
Expand All @@ -67,11 +67,11 @@ func withServer(
server := httptest.NewServer(r)
defer server.Close()
testFn(&testServer{
metricsFactory: metricsFactory,
samplingStore: samplingProvider,
bgMgr: bgMgr,
server: server,
handler: handler,
metricsFactory: metricsFactory,
samplingProvider: samplingProvider,
bgMgr: bgMgr,
server: server,
handler: handler,
})
}

Expand Down Expand Up @@ -112,15 +112,15 @@ func testHTTPHandler(t *testing.T, basePath string) {
objResp := &tSampling092.SamplingStrategyResponse{}
require.NoError(t, json.Unmarshal(body, objResp))
assert.EqualValues(t,
ts.samplingStore.samplingResponse.GetStrategyType(),
ts.samplingProvider.samplingResponse.GetStrategyType(),
objResp.GetStrategyType())
assert.EqualValues(t,
ts.samplingStore.samplingResponse.GetRateLimitingSampling().GetMaxTracesPerSecond(),
ts.samplingProvider.samplingResponse.GetRateLimitingSampling().GetMaxTracesPerSecond(),
objResp.GetRateLimitingSampling().GetMaxTracesPerSecond())
} else {
objResp, err := p2json.SamplingStrategyResponseFromJSON(body)
require.NoError(t, err)
assert.EqualValues(t, ts.samplingStore.samplingResponse, objResp)
assert.EqualValues(t, ts.samplingProvider.samplingResponse, objResp)
}
})
}
Expand Down

0 comments on commit 0647b51

Please # to comment.