mockDistibutorFor duplicates the chunks in the mockChunkStore into the mockDistributor so we can test everything is dedupe correctly.
(t *testing.T, cks []chunk.Chunk)
| 1316 | // mockDistibutorFor duplicates the chunks in the mockChunkStore into the mockDistributor |
| 1317 | // so we can test everything is dedupe correctly. |
| 1318 | func mockDistibutorFor(t *testing.T, cks []chunk.Chunk) *MockDistributor { |
| 1319 | //parallel testing causes data race |
| 1320 | chunks, err := chunkcompat.ToChunks(cks) |
| 1321 | require.NoError(t, err) |
| 1322 | |
| 1323 | tsc := client.TimeSeriesChunk{ |
| 1324 | Labels: []cortexpb.LabelAdapter{{Name: model.MetricNameLabel, Value: "foo"}}, |
| 1325 | Chunks: chunks, |
| 1326 | } |
| 1327 | |
| 1328 | result := &MockDistributor{} |
| 1329 | result.On("QueryStream", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&client.QueryStreamResponse{Chunkseries: []client.TimeSeriesChunk{tsc}}, nil) |
| 1330 | return result |
| 1331 | } |
| 1332 | |
| 1333 | func testRangeQuery(t testing.TB, queryable storage.Queryable, queryEngine promql.QueryEngine, end model.Time, q query, enc promchunk.Encoding) *promql.Result { |
| 1334 | from, through, step := time.Unix(0, 0), end.Time(), q.step |
no test coverage detected