MCPcopy Index your code
hub / github.com/cortexproject/cortex / TestNewApiWithSourceIPExtractor

Function TestNewApiWithSourceIPExtractor

pkg/api/api_test.go:42–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestNewApiWithSourceIPExtractor(t *testing.T) {
43 cfg := Config{}
44 serverCfg := server.Config{
45 HTTPListenNetwork: server.DefaultNetwork,
46 LogSourceIPs: true,
47 MetricsNamespace: "with_source_ip_extractor",
48 }
49 server, err := server.New(serverCfg)
50 require.NoError(t, err)
51
52 api, err := New(cfg, serverCfg, server, &FakeLogger{})
53 require.NoError(t, err)
54 require.NotNil(t, api.sourceIPs)
55}
56
57func TestNewApiWithInvalidSourceIPExtractor(t *testing.T) {
58 cfg := Config{}

Callers

nothing calls this directly

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected