MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestNewApiWithInvalidSourceIPExtractor

Function TestNewApiWithInvalidSourceIPExtractor

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

Source from the content-addressed store, hash-verified

55}
56
57func TestNewApiWithInvalidSourceIPExtractor(t *testing.T) {
58 cfg := Config{}
59 s := server.Server{
60 HTTP: &mux.Router{},
61 }
62 serverCfg := server.Config{
63 HTTPListenNetwork: server.DefaultNetwork,
64 LogSourceIPs: true,
65 LogSourceIPsHeader: "SomeHeader",
66 LogSourceIPsRegex: "[*",
67 MetricsNamespace: "with_invalid_source_ip_extractor",
68 }
69
70 api, err := New(cfg, serverCfg, &s, &FakeLogger{})
71 require.Error(t, err)
72 require.Nil(t, api)
73}
74
75func TestNewApiWithHeaderLogging(t *testing.T) {
76 cfg := Config{

Callers

nothing calls this directly

Calls 2

NewFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected