(t *testing.T, start, end int64, stepDuration int64)
| 470 | } |
| 471 | |
| 472 | func createTestLogicalPlan(t *testing.T, start, end int64, stepDuration int64) []byte { |
| 473 | startTime, endTime := convertMsToTime(start), convertMsToTime(end) |
| 474 | step := convertMsToDuration(stepDuration) |
| 475 | |
| 476 | qOpts := query.Options{ |
| 477 | Start: startTime, |
| 478 | End: startTime, |
| 479 | Step: 0, |
| 480 | StepsBatch: 10, |
| 481 | LookbackDelta: 0, |
| 482 | EnablePerStepStats: false, |
| 483 | } |
| 484 | |
| 485 | if step != 0 { |
| 486 | qOpts.End = endTime |
| 487 | qOpts.Step = step |
| 488 | } |
| 489 | |
| 490 | // using a different metric name here so that we can check with debugger which query (from query string vs http request body) |
| 491 | // is being executed by the queriers |
| 492 | expr, err := parser.NewParser("up", parser.WithFunctions(parser.Functions)).ParseExpr() |
| 493 | require.NoError(t, err) |
| 494 | |
| 495 | planOpts := logicalplan.PlanOptions{ |
| 496 | DisableDuplicateLabelCheck: false, |
| 497 | } |
| 498 | |
| 499 | logicalPlan, err := logicalplan.NewFromAST(expr, &qOpts, planOpts) |
| 500 | require.NoError(t, err) |
| 501 | byteval, err := logicalplan.Marshal(logicalPlan.Root()) |
| 502 | require.NoError(t, err) |
| 503 | |
| 504 | return byteval |
| 505 | } |
no test coverage detected