(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestBuildShardedRequests(t *testing.T) { |
| 16 | queryShards := 2 |
| 17 | |
| 18 | sharder := &asyncTraceSharder{ |
| 19 | cfg: &TraceByIDConfig{ |
| 20 | QueryShards: queryShards, |
| 21 | }, |
| 22 | blockBoundaries: blockboundary.CreateBlockBoundaries(queryShards - 1), |
| 23 | } |
| 24 | |
| 25 | ctx := user.InjectOrgID(context.Background(), "blerg") |
| 26 | req := httptest.NewRequest("GET", "/", nil).WithContext(ctx) |
| 27 | |
| 28 | shardedReqs, err := sharder.buildShardedRequests(pipeline.NewHTTPRequest(req)) |
| 29 | require.NoError(t, err) |
| 30 | require.Len(t, shardedReqs, queryShards) |
| 31 | |
| 32 | require.Equal(t, "/querier?mode=ingesters", shardedReqs[0].HTTPRequest().RequestURI) |
| 33 | urisEqual(t, []string{"/querier?blockEnd=ffffffffffffffffffffffffffffffff&blockStart=00000000000000000000000000000000&mode=blocks"}, []string{shardedReqs[1].HTTPRequest().RequestURI}) |
| 34 | } |
| 35 | |
| 36 | func TestBuildShardedRequestsWithExternal(t *testing.T) { |
| 37 | queryShards := 4 |
nothing calls this directly
no test coverage detected