Skip to content

test: run an out-of-tree MetricsQL corpus from $ASAP_EXTERNAL_CORPUS_DIR - #1162

Merged
milindsrivastava1997 merged 1 commit into
mainfrom
test/external-corpus
Nov 2, 2026
Merged

milindsrivastava1997 merged 1 commit into
mainfrom
test/external-corpus

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Collaborator

Why

The private corpus (ASAPPlanner-private-corpus) #[path]-included crates/frontend-promql/tests/support.rs and kept its own Cargo.toml dependency list. Whenever support.rs started importing a new crate or feature-gated module, public CI stayed green and the private nightly broke the next morning. That happened twice in a week: asap-types test-support (private #4/#5), then logical-asap-optimization::test_support after #1108.

What

Moves the test runner into public; the private repo keeps only the queries.

  • crates/frontend-metricsql/tests/external_corpus.rs: lowers and binds every query in every *.txt under $ASAP_EXTERNAL_CORPUS_DIR, checks that nothing panics, nothing that lowers fails to bind, and each file's lowered count stays at or above its # floor: N line. Prints failure causes by count. Skips when the env var is unset, so CI compiles it on every PR but needs no data.
  • Includes support.rs (for logical_plan) via #[path] in the metricsql test binary, and adds asap-logical-asap-optimization (test-support) as a dev-dependency. A future support.rs import change now fails here, in the PR that makes it.

Run locally:

ASAP_EXTERNAL_CORPUS_DIR=<private-corpus>/data cargo test -p asap-frontend-metricsql --test metricsql external_corpus:: -- --nocapture

Testing

  • With the env var unset: skips and passes.
  • Against the private data: passes with the same floors as before.
  • Raising one floor to 999: fails as expected.
  • Workspace clippy --all-targets --all-features -D warnings: clean.

Companion PR in ASAPPlanner-private-corpus (chore/data-only); merge this one first, since that repo's CI runs against public main.

Note: the pre-commit cargo test failed once on two asap-devtools stage_pipeline tests ("MILP solver: execution-scope expansion exceeded the deadline"). They're timing-sensitive under full-suite load and pass in isolation; they're unrelated to this change.

🤖 Generated with Claude Code

Moves the private corpus's test runner into public so it compiles with
public's own dev-dependencies on every PR. A change to the shared
support.rs now fails its own PR instead of the private nightly. The
test skips when the env var is unset; floors come from a `# floor: N`
line in each corpus file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 merged commit d7ba27b into main Nov 2, 2026
3 checks passed
@zzylol
zzylol deleted the test/external-corpus branch November 3, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant