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

Function TestNoOrgId

pkg/ruler/frontend_client_test.go:39–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestNoOrgId(t *testing.T) {
40 mockClientFn := func(ctx context.Context, _ *httpgrpc.HTTPRequest, _ ...grpc.CallOption) (*httpgrpc.HTTPResponse, error) {
41 return nil, nil
42 }
43 frontendClient := NewFrontendClient(mockHTTPGRPCClient(mockClientFn), time.Second*5, "/prometheus", "json")
44 _, err := frontendClient.InstantQuery(context.Background(), "query", time.Now())
45 require.Equal(t, user.ErrNoOrgID, err)
46}
47
48func TestInstantQueryJsonCodec(t *testing.T) {
49 tests := []struct {

Callers

nothing calls this directly

Calls 4

InstantQueryMethod · 0.95
mockHTTPGRPCClientFuncType · 0.85
NewFrontendClientFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected