Skip to content

Fix e2e test conflict scenario and improve action debugging#6

Merged
Phlogistique merged 3 commits into
mainfrom
claude/refactor-e2e-tests-rTy1Z
Dec 25, 2025
Merged

Fix e2e test conflict scenario and improve action debugging#6
Phlogistique merged 3 commits into
mainfrom
claude/refactor-e2e-tests-rTy1Z

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator
  • 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

- 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
@Phlogistique
Phlogistique merged commit e6fa4c9 into main Dec 25, 2025
@github-actions
github-actions Bot deleted the claude/refactor-e2e-tests-rTy1Z branch December 25, 2025 08:17
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.

2 participants