log_parsers: keep cargo should_panic and doctest results - #139
Merged
Merged
Conversation
libtest writes `test {name} - {mode} ... ` for should_panic, compile_fail
and no_run tests, and doctest names contain spaces. The `\S+` name pattern
matched none of them, so a fix whose new test is #[should_panic] had no
FAIL_TO_PASS test and was dropped at validation.
Doctests are keyed by file and item without `(line N)`: the line moves
whenever a patch edits code above the doctest, so a verbatim key made a
correct agent patch that shifted lines score as a P2P regression. The
worst status among an item's doctests wins.
Both the canonical parser and the standalone verifier copy change, and
the new tests run against both using real rustc 1.98.1 output.
Closes huggingface#138
Collaborator
|
Thanks, tested and merged. The should_panic and shifted-doctest cases now work in both parsers. Existing Cargo tasks will need their verifier and test IDs updated together. |
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.
Summary
tests::x - should panic,src/lib.rs - add (line 30) - compile fail), in bothlog_parsers/cargo_parser.pyand the standalone copy in_pr_runtime_verifier.py. On main, these lines don't match, so a fix whose new test is#[should_panic]has no FAIL_TO_PASS test and gets dropped.(line N), and let the worst status among an item's doctests win. The line number moves whenever a patch edits code above a doctest, so a verbatim key would score a correct patch that shifts lines as a regression....separator instead of\s+\.\.\.\s+, so names can contain spaces without backtracking on long lines.The reproduction from #138 uses real
cargo testoutput. The reference fix keeps the doctest at(line 3). The agent's patch is equally correct but adds a helper abovediv, which moves the doctest to(line 9).[]dividesrejects_zerodivides,src/lib.rs - div (line 3)rejects_zerodivides,src/lib.rs - divTest plan
uv run --all-extras pytest -q: 1912 passed, 6 skipped (live-network tests)uv run ruff check .anduv run ruff format --check .tests/test_cargo_test_names.pyruns every case against both parsers, the same waytests/test_pytest_node_ids.pydoes. Its fixtures are verbatimcargo test --no-fail-fastoutput from rustc 1.98.1: one crate covering every test mode, plus the pre-fix, reference-fix and agent runs above.python -I, grades the shifted-doctest agent run at reward 1.0 withresolved=True.Out of scope
cargo nextest,--format terseor JSON output, and ANSI-colored logs.Closes #138