fix(e2e): chain on_exit in constraint test EXIT traps#1091
fix(e2e): chain on_exit in constraint test EXIT traps#1091mergify[bot] merged 1 commit intopython-wheel-build:mainfrom
Conversation
The three constraint e2e tests registered their own trap ... EXIT which silently replaced the on_exit handler from common.sh. Chain on_exit in each trap and switch to single quotes so $constraints_file is expanded at exit time rather than registration time. Closes: python-wheel-build#1062 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Justin Larkin <jlarkin@redhat.com> Made-with: Cursor
📝 WalkthroughWalkthroughThree e2e test scripts are modified to prevent their EXIT traps from silently replacing the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
e2e/test_bootstrap_constraints.sh (1)
14-14: Consider restoring SIGINT/SIGTERM coverage.
common.shoriginally registeredtrap on_exit EXIT SIGINT SIGTERM. Replacing it withEXITonly (as done here and in the other two scripts) still narrows signal coverage vs. the original. In practice bash usually runsEXITon signal-induced exit, so impact is low, but matching the original list is cheap and safer:Proposed tweak
-trap 'rm -f "$constraints_file"; on_exit' EXIT +trap 'rm -f "$constraints_file"; on_exit' EXIT SIGINT SIGTERM🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@e2e/test_bootstrap_constraints.sh` at line 14, The trap registration was narrowed to only EXIT; restore the original signal coverage by adding SIGINT and SIGTERM back to the trap invocation so that on_exit (and the cleanup of "$constraints_file") runs on those signals too—update the trap statement that references on_exit and "$constraints_file" to trap 'rm -f "$constraints_file"; on_exit' EXIT SIGINT SIGTERM.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@e2e/test_bootstrap_constraints.sh`:
- Line 14: The trap registration was narrowed to only EXIT; restore the original
signal coverage by adding SIGINT and SIGTERM back to the trap invocation so that
on_exit (and the cleanup of "$constraints_file") runs on those signals
too—update the trap statement that references on_exit and "$constraints_file" to
trap 'rm -f "$constraints_file"; on_exit' EXIT SIGINT SIGTERM.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b4b014d8-d373-47df-bc9a-29b38566c46b
📒 Files selected for processing (3)
e2e/test_bootstrap_conflicting_requirements.she2e/test_bootstrap_constraints.she2e/test_bootstrap_multiple_versions.sh
fix(e2e): chain on_exit in constraint test EXIT traps
The three constraint e2e tests registered their own trap ... EXIT which silently replaced the on_exit handler from common.sh. Chain on_exit in each trap and switch to single quotes so $constraints_file is expanded at exit time rather than registration time.
Closes: #1062