Skip to content

chore(querier): Ensure Plan is set in test QueryRequest/SampleQueryRequest - #24136

Open
chaudum wants to merge 1 commit into
mainfrom
chaudum/query-request-plan
Open

chore(querier): Ensure Plan is set in test QueryRequest/SampleQueryRequest#24136
chaudum wants to merge 1 commit into
mainfrom
chaudum/query-request-plan

Conversation

@chaudum

@chaudum chaudum commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Add testutil.MustPlan() helper to create QueryPlan from selector strings and update all test files to use it instead of inline plan literals.

This is step 1 of the QueryRequest.Selector to QueryRequest.Plan migration: ensuring Plan is always populated on every producer.

Changes:

  • Add pkg/querier/testutil/requests.go with MustPlan() helper
  • Update 22 test files to use testutil.MustPlan() (115 instances)
  • 32 instances remain where AST uses pre-parsed expressions

The fallback code in ingester and marshal layers remains for version-skew compatibility during rollout.

…quest

Add testutil.MustPlan() helper to create QueryPlan from selector strings
and update all test files to use it instead of inline plan literals.

This is step 1 of the QueryRequest.Selector to QueryRequest.Plan migration
(loki-private#2709): ensuring Plan is always populated on every producer.

Changes:
- Add pkg/querier/testutil/requests.go with MustPlan() helper
- Update 22 test files to use testutil.MustPlan() (115 instances)
- 32 instances remain where AST uses pre-parsed expressions

The fallback code in ingester and marshal layers remains for version-skew
compatibility during rollout.
@chaudum
chaudum marked this pull request as ready for review August 21, 2026 15:26
@chaudum
chaudum requested a review from a team as a code owner August 21, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant