test(promql): add a small o11y-bench-derived PromQL corpus - #136
Merged
Merged
Conversation
27 deduplicated queries pulled from grafana/o11y-bench's task-grading rubrics — realistic SRE incident/investigation PromQL (error ratios, burn rate, cache-lag/retry-backlog triage, capacity checks). All 27 lower cleanly; asserts full coverage since the corpus is small and hand-picked rather than a statistical sample. o11y-bench is AGPL-3.0, unlike this repo's other MIT/Apache-2.0 corpora — that's an open question, tracked in #135, not resolved here.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/observability/data/o11y_bench_promql.txt: 27 deduplicated PromQL queries extracted from grafana/o11y-bench'stasks-spec/**/*.yamlgrading rubrics (fact.querywherebackend: prometheus) — realistic SRE incident-response queries (error ratios, burn-rate assessment, cache-lag/retry-backlog triage, capacity checks).tests/observability/o11y_bench_promql.rs, mirroring the existingawesome_prometheus_alerts.rspattern: lowers every query (no execution) and asserts totality (Ok/cleanErr, never panics). Since this corpus is small and hand-curated rather than a large statistical sample, it also pins full coverage (all 27 lower cleanly today) instead of a coverage floor.crates/frontend-promql/Cargo.toml.Licensing concern — not resolved by this PR
o11y-benchis AGPL-3.0, unlike this repo's other vendored corpora (awesome_prometheus_alerts.txtis MIT,promql_corpus_testdata.txt/promql_corpus_docs.txtare from Prometheus docs / PromLabs). Copying these short query-expression fixtures verbatim into a differently-licensed test suite raises an open question that this PR does not settle — tracked in #135. The corpus file and test module both carry a comment pointing at that issue.Test plan
cargo test -p asap-frontend-promql --test o11y_bench_promql -- --nocapture— 1 passed, all 27 queries lower cleanly.cargo test -p asap-frontend-promql— full crate suite (44 existing tests + new one) passes.cargo clippy -p asap-frontend-promql --all-targets— clean.🤖 Generated with Claude Code