Skip to content

Rename test corpus directories by what they test (lowering vs plan snapshots) #1419

Done

Description

@milindsrivastava1997

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:

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's Cargo.toml. This changes cargo test --test <name> commands and any CI or nightly job that uses them.
  • devtools programs: analyze_corpora, variant_coverage and sketch_coverage load 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

Activity

  1. added
    testing
    on Nov 18, 2026
  2. milindsrivastava1997 commented on Nov 23, 2026

    @milindsrivastava1997
    CollaboratorAuthor

    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:

    Constraints:

    • The workspace root is a virtual manifest, so a root tests/ directory can't hold Rust tests. The tests need a package, either a new crate (e.g. crates/planner-tests) or the existing crates/integration-tests.
    • The golden runner and snapshot tests run asap_planner as a subprocess via env!("CARGO_BIN_EXE_asap_planner") (D7), which only works for a binary in the same package. So either the asap_planner binary moves with the tests, or the tests find or build it some other way.
    • .github/workflows/corpus-snapshots.yml runs -p asap-devtools --test corpus_snapshots by name and needs updating.

    Suggest doing this rename and move in one PR, after #1467 lands.

  3. milindsrivastava1997 commented on Nov 24, 2026

    @milindsrivastava1997
    CollaboratorAuthor

    Done in #1482, with two changes from the layout above:

    • No plan_snapshots/ directory. corpus_snapshots and sketch_plan_snapshots move as they are to crates/planner-cli/tests/ and will fold into tests/goldens/ (D27, which now covers both).
    • The PromQL docs + testdata corpus is lowering_corpora/promql_corpus/, not promql_docs/, because it holds both sources.

    Test target names are unchanged; only -p asap-devtools becomes -p asap-planner-cli for asap_planner, goldens and corpus_snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

refactortesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions