Fix e2e test conflict scenario and improve action debugging#6
Merged
Conversation
- Expand test file from 3 to 7 lines to avoid git treating adjacent line changes as overlapping hunks (was causing spurious conflicts) - Use line 7 instead of line 3 for conflict test (more separation) - Fix $CHILD -> $BRANCH typo in conflict resolution instructions - Add explicit branch parameter to gh pr comment/edit commands - Add pipefail to catch pipeline failures - Wrap git merge --abort and gh commands in log_cmd for visibility - Add debug output at script start for troubleshooting
Test fixes: - Expand test file from 3 to 7 lines to avoid git's adjacent-line conflict heuristic causing spurious merge conflicts - Use line 7 instead of line 3 for conflict scenario testing - Fix conflict resolution: use deterministic file creation instead of buggy sed-based conflict marker removal - Add PRESERVE_ON_FAILURE option for debugging failed tests - Use fail_test() wrapper for proper cleanup flag handling Action fixes: - Fix $CHILD -> $BRANCH typo in conflict resolution instructions - Add explicit branch parameter to gh pr comment/edit commands to ensure they work correctly in GitHub Actions context - Create autorestack-needs-conflict-resolution label before adding it to PR (gh pr edit --add-label fails if label doesn't exist) - Add pipefail to catch pipeline failures - Wrap git merge --abort and gh commands in log_cmd for visibility
- Remove fail_test helper and TEST_FAILED mechanism since the script uses 'set -e', so failures exit automatically. Use exit code in cleanup trap instead. - Replace hardcoded conflict resolution with 'git checkout --ours' which correctly preserves feature3's changes to both line 2 and line 7 - Remove redundant 'git pull origin main' commands since we use 'origin/main' references directly and don't need local main updated
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.
line changes as overlapping hunks (was causing spurious conflicts)