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

Function TestReadUserIndex_Corrupted

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

Source from the content-addressed store, hash-verified

64}
65
66func TestReadUserIndex_Corrupted(t *testing.T) {
67 t.Parallel()
68
69 ctx := context.Background()
70 bkt := &bucket.ClientMock{}
71
72 // Mock a corrupted index file
73 bkt.MockGet(UserIndexCompressedFilename, "invalid gzip content", nil)
74
75 // Test reading corrupted index
76 _, err := ReadUserIndex(ctx, bkt, log.NewNopLogger())
77 require.Error(t, err)
78 assert.Equal(t, ErrIndexCorrupted, err)
79}
80
81func TestUserIndex_GetUpdatedAt(t *testing.T) {
82 t.Parallel()

Callers

nothing calls this directly

Calls 4

MockGetMethod · 0.95
ReadUserIndexFunction · 0.85
EqualMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected