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

Function TestWriteUserIndex_Error

pkg/util/users/index_test.go:93–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

91}
92
93func TestWriteUserIndex_Error(t *testing.T) {
94 t.Parallel()
95
96 ctx := context.Background()
97 bkt := &bucket.ClientMock{}
98
99 // Mock upload error
100 bkt.MockUpload(UserIndexCompressedFilename, assert.AnError)
101
102 // Test writing index with error
103 err := WriteUserIndex(ctx, bkt, &UserIndex{})
104 require.Error(t, err)
105 assert.Contains(t, err.Error(), "upload user index")
106}

Callers

nothing calls this directly

Calls 3

MockUploadMethod · 0.95
WriteUserIndexFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected