Skip to content

Conversation

@youknowone
Copy link
Member

@youknowone youknowone commented Feb 2, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced crash resilience in test auto-marking by preserving and restoring original test markers during incomplete runs or failures.
  • Tests

    • Added comprehensive test coverage for crash and incomplete test run scenarios to verify proper marker restoration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This PR adds crash recovery logic to auto-mark functionality that preserves and restores original test file contents when test runs crash or remain incomplete, preventing permanent loss of unittest markers during failed or partial test executions.

Changes

Cohort / File(s) Summary
Auto-mark crash recovery implementation
scripts/update_lib/cmd_auto_mark.py
Added preservation of original file contents before marker stripping; restoration logic engages on test run failure, crash, or incomplete execution; per-file tracking of original content and stripped markers.
Auto-mark crash recovery tests
scripts/update_lib/tests/test_auto_mark.py
Added test classes TestAutoMarkFileRestoresOnCrash and TestAutoMarkDirectoryRestoresOnCrash with scenarios verifying marker restoration after crashes and proper handling during complete test runs.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

skip:ci

Suggested reviewers

  • fanninpm
  • ShaharNaveh

Poem

🐰 When tests do crash and markers fade,
A rabbit's code comes to the aid!
With restored contents, safe and sound,
Lost decorators are quickly found! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'auto-mark original contents recovery' directly describes the main change: restoring original file contents during test auto-marking on crashes/incomplete runs.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@youknowone youknowone marked this pull request as ready for review February 2, 2026 06:57
@youknowone youknowone merged commit 2f03413 into RustPython:main Feb 2, 2026
13 checks passed
@youknowone youknowone deleted the auto-mark branch February 2, 2026 07:03
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