Skip to content

test(planner-cli): plan an external corpus end to end and count what plans #1498

Backlog

Description

@milindsrivastava1997

Problem

No test runs a real corpus through the whole planner without also checking committed snapshots. The old external corpus test checked that each lowered query bound in Pass 1; the crate graph now forbids that from a frontend's tests.

Change

  • Add a planner-cli test target. It has to live in this package because CARGO_BIN_EXE_asap_planner is only set here.
  • It reads $ASAP_EXTERNAL_CORPUS_DIR: *.txt query files and a corpus.json in the format corpus_snapshots uses (query template, data_workload, asap_planner_args).
  • For each query it builds a one-query workload with the same workload() helper as corpus_snapshots (shared, not copied) and runs asap_planner --run-until stage3 --format json.
  • Each query ends as crashed, planned (Stage 3 has a plan) or not planned (Stage 3 has an error).
  • It fails on any crash or when planned is below the file's # plan_floor: N, and prints the not-planned causes by count.
  • It skips when the variable is unset.

First: confirm #1340 is fixed on main (MetricsQL now goes to lower_metricsql_roots, from #1239) and close it if so.

Done when

  • It passes with the variable unset.
  • It passes on a small sample corpus with one query that plans and one that doesn't, in --release.

Depends on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions