Skip to content

test(frontend-metricsql): restore the external MetricsQL corpus test as a lowering corpus #1497

Done

Description

@milindsrivastava1997

Problem

#1207 PR 0 (#1226) and PR 0b (#1229) deleted crates/frontend-metricsql/tests/external_corpus.rs. A private corpus repo ran it nightly with ASAP_EXTERNAL_CORPUS_DIR; those runs now match zero tests and fail. The test crossed stage crates: it bound each query through Pass 1 via the PromQL test support.

Change

  • Add crates/frontend-metricsql/tests/lowering_corpora/external_corpus/external_corpus.rs and [[test]] name = "external_corpus", following test: rename test directories; move asap_planner outside devtools #1482's lowering_corpora/ layout.
  • Restore queries, floor, normalize and floor_line from 6bcf398^.
  • Add corpus_lowers: for every *.txt in $ASAP_EXTERNAL_CORPUS_DIR, lower each query with lower_metricsql_query(q, 15s); count lowered, unparseable and rejected; fail on a panic or when lowered is below the file's # floor: N; print the failure causes by count.
  • Skip when the variable is unset, so PR CI only compiles it.
  • Leave binding out. Planning the corpus end to end is a separate issue, through the binary.

Done when

  • cargo test -p asap-frontend-metricsql --test external_corpus passes with the variable unset.
  • It passes against a sample directory with a # floor: file.
  • crate_graph still passes.

Depends on

Nothing.

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

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