Repository navigation
test(frontend-metricsql): clearer failures in the external corpus test - #1502
Merged
Merged
Conversation
Follow-up to #1501's late review: - a lowering panic names the file and query; - a malformed `# floor:` line says so instead of "missing"; - read errors name the file; - an empty ASAP_EXTERNAL_CORPUS_DIR skips like an unset one; - normalize's doc matches what it does (all-digit words only, and why); - floor_line states what it checks; - the sample directory is per process. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1501 (#1497).
Summary
A late review of #1501 found seven minor problems in
crates/frontend-metricsql/tests/lowering_corpora/external_corpus/external_corpus.rs. This PR fixes all seven. Six change behavior or docs as suggested; for #5 the doc comment is narrowed rather than the code, for the reason given below.Review comments and replies
tallywraps each lowering incatch_unwind, prints<file>: lowering panicked on "<query>", thenresume_unwinds, so the original panic message and location are kept.# floor: ~40fails with "no# floor: Nline".floorreturnsResult<usize, String>: "no# floor: Nline" vs "# floor: ~40: not a whole number".entry.unwrap()andread_to_string(..).unwrap()panic without the path.<path>: stream did not contain valid UTF-8.ASAP_EXTERNAL_CORPUS_DIRis treated as unset.normalizedoesn't match its doc comment (:48). It only replaces all-digit words, so5mand10mstay different. Replace numbers inside words too, or narrow the comment.log2andlog10intologN, and the cause histogram exists to show which features block queries. Keeping5m/10mapart costs less. The comment now says so, andfloor_linepins it.floor_linetest has no description (:156), and coversqueriesandnormalize, which its name doesn't suggest.normalizebehavior from #5.floor_is_enforced_per_file(:141). Concurrent runs share the directory.Review guide
One file.
tally(panic naming),floor(now aResult),check_dir(paths in read errors),corpus_lowers(empty var), and the two tests.Behavior: before → after
Interfaces
None (test-only).
Algorithm changes
None.
Decisions and open questions
tally. It was checked by hand (below).Verification
cargo test -p asap-frontend-metricsql --test external_corpus: 3 passed;cargo clippy -D warnings,cargo fmt --checkclean; pre-commitcargo testpassed.ASAP_EXTERNAL_CORPUS_DIR:# floor: ~40→a: \# floor: ~40`: not a whole number`;<path>: stream did not contain valid UTF-8;a: lowering panicked on "PANIC_ME"(edit reverted);🤖 Generated with Claude Code