Repository navigation
Description
Problem
The test directory names don't say what a test checks. Some name the source of the queries (data_quality_check/, netflow/, observability/), one names the method (corpus_snapshots/), and one names what gets planned (sketch_plan_snapshots/). Both the frontend tests and the devtools tests run corpora and compare against saved expected results, so the names alone don't show which tests stop at the frontend and which run the whole planner.
Other problems:
frontend-sql/tests/data_quality_check/holds two unrelated corpora: TPC-H Deequ checks and a synthetic packet trace. The sidra TPC-H corpus (tpch_rich.rs, test(frontend-sql): SQL corpus of sidra's six generated TPC-H data-quality workloads #1293) also goes there.frontend-promql/tests/observability/is named for a domain, but what it holds are PromQL lowering corpora.
Proposed layout
The directory says how far the queries go, and the subdirectory says where they come from.
Frontend-only tests (SQL or PromQL to operator tree):
crates/frontend-sql/tests/lowering_corpora/
tpch_deequ/ tpch_rich/ packet_trace/ netflow/ bgp_analytics/ bgp_jan2024/ clickbench/
crates/frontend-promql/tests/lowering_corpora/ (today: observability/)
promql_docs/ awesome_prometheus_alerts/ o11y_bench/ metrics_observability/
This splits data_quality_check/ into tpch_deequ/ and packet_trace/, and adds tpch_rich/ alongside them.
Full planner runs (devtools):
crates/devtools/tests/plan_snapshots/
single_query/ (today: corpus_snapshots/) one query at a time, no accuracy target
multi_query/ (today: sketch_plan_snapshots/) whole workloads with accuracy targets, sketches, sharing
Other wording options: frontend_corpora for lowering_corpora, or stage3_snapshots for plan_snapshots.
What else has to change
- Test names: the
[[test]]names and paths in each crate'sCargo.toml. This changescargo test --test <name>commands and any CI or nightly job that uses them. - devtools programs:
analyze_corpora,variant_coverageandsketch_coverageload the frontend corpora by relative file path, so each needs its paths updated. - Docs:
TESTING-INFRA.md,docs/develop_docs/planner-snapshots.md,docs/develop_docs/metrics-observability-corpora.md, and the doc comments that name these paths.
Related
- No test currently counts how many queries get through each stage. That test was
frontend-promql/tests/observability/metrics_observability.rs, deleted in refactor: define every stage's interfaces from #1207 and delete the ones they replace (#1207 PR 0) #1226 (Tracking: implement the optimization formulation (memo candidates, properties, edges y_{u,c,i}, MILP) as named code per stage #1207 PR 0). Its query files remain underobservability/data/metrics_observability/. If that kind of test comes back, it should go in its own directory, separate from the lowering-only and snapshot tests, for examplestage_coverage/. - test(frontend-sql): SQL corpus of sidra's six generated TPC-H data-quality workloads #1293 adds
tpch_richunderdata_quality_check/. It should move together with the rest of the directory.
Activity
milindsrivastava1997 commentedon Nov 23, 2026
Additional scope, from review on #1467: move the end-to-end and per-stage planner tests out of
asap-devtools, which is for inspecting the planner, not testing it.What would move:
crates/devtools/tests/goldens.rsand its cases intests/goldens/(added in test(devtools): golden runner and first Stage 0 cases #1467, testing-infrastructure PR 1, Testing infrastructure: tracking #1354);corpus_snapshots,sketch_plan_snapshots;plan_snapshots/in the layout above), which D27 plans to fold into the goldens anyway.Constraints:
tests/directory can't hold Rust tests. The tests need a package, either a new crate (e.g.crates/planner-tests) or the existingcrates/integration-tests.asap_planneras a subprocess viaenv!("CARGO_BIN_EXE_asap_planner")(D7), which only works for a binary in the same package. So either theasap_plannerbinary moves with the tests, or the tests find or build it some other way..github/workflows/corpus-snapshots.ymlruns-p asap-devtools --test corpus_snapshotsby name and needs updating.Suggest doing this rename and move in one PR, after #1467 lands.
test(frontend): group corpus tests under lowering_corpora/<source>/
refactor: asap_planner and its tests move from devtools to asap-plann…
milindsrivastava1997 commentedon Nov 24, 2026
Done in #1482, with two changes from the layout above:
plan_snapshots/directory.corpus_snapshotsandsketch_plan_snapshotsmove as they are tocrates/planner-cli/tests/and will fold intotests/goldens/(D27, which now covers both).lowering_corpora/promql_corpus/, notpromql_docs/, because it holds both sources.Test target names are unchanged; only
-p asap-devtoolsbecomes-p asap-planner-cliforasap_planner,goldensandcorpus_snapshots.test: rename test directories; move asap_planner outside devtools (#1482