Make auto-mark output deterministic and fix blank line leak by youknowone · Pull Request #6957 · RustPython/RustPython
📝 Walkthrough
Walkthrough
This PR makes patch generation deterministic by sorting test parts and class/test names, tightens method-removal to also remove a preceding blank line, broadens the definition of a failed test run to accept partial results, adds tests for crashed/partial runs, and adds a new code test dependency mapping.
Changes
| Cohort / File(s) | Summary |
|---|---|
Auto-mark and patch ordering scripts/update_lib/cmd_auto_mark.py, scripts/update_lib/patch_spec.py |
Sorts test parts and class/test names to produce deterministic patch ordering. Adjusts _method_removal_range to remove a preceding blank line when deleting a method. Broadens failure-detection logic in auto_mark_file and auto_mark_directory to allow partial results. |
Tests for crashed/partial runs scripts/update_lib/tests/test_auto_mark.py |
Adds unit tests covering crashed test runs, unexpected successes, partial parsed results, and error raising when zero results are parsed; includes mocking of test-run and module-name helpers. |
Dependency mappings scripts/update_lib/deps.py |
Adds a code entry to DEPENDENCIES with test: ["test_code_module.py"] to include an irregular test dependency for code-related tests. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- automark add reasons to reason-less expectedFailures and handles parent better #6936 — Overlapping changes to
cmd_auto_mark.py(method removal and patch ordering). - update_lib hard dependency resolver #6817 — Related changes to
deps.pyDEPENDENCIES mapping for test entries. - more deps grouping #6931 — Adds/edits entries in
deps.pyDEPENDENCIES table (similar dependency adjustments).
Suggested labels
skip:ci
Suggested reviewers
- ShaharNaveh
- moreal
Poem
🐰 I hopped through diffs with tidy feet,
Sorted tests so patches meet,
I nibbled blank lines, one by one,
Kept partial runs when tests were done,
A small bright patch — now work's more neat.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly describes the main changes: making auto-mark output deterministic and fixing a blank line issue that affects the output. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.