Commit f79392b
Fix e2e test scenario merge logic (#4)
* fix(tests): update e2e test to work with gh CLI v2.83.2
- Fix workflow run matching to use headBranch instead of unavailable eventPayload field
- Reorganize conflict scenario to introduce conflicts in correct order
- Update step numbering for clarity
- Add GitHub API call to update PR branch before merging in conflict scenario
The initial merge test now passes successfully. The conflict scenario test reveals
an issue with updating branches that have synthetic merge commits, which needs
further investigation.
* feat: add idempotent e2e test runner script
- Create .claude/run-e2e-tests.sh that idempotently:
- Installs gh CLI if not present
- Acquires GitHub App token
- Configures git and gh auth
- Runs e2e tests
- Restores git config on exit
- Move get_github_app_token.py to .claude directory
- Add .claude/README.md documenting the scripts
- Script includes colored output and proper error handling
* refactor: remove color codes from e2e runner script
Bots don't need pretty colors, just clear logging
* feat: add token caching with expiration checking
- Cache tokens to /tmp/gh_app_token_cache.json with expiration time
- Reuse cached tokens if they're still valid (with 5-minute buffer)
- Only generate new tokens when cache is missing or expired
- Log cache status to stderr (using cached/generating new)
Tokens are now reused across multiple script runs, reducing API calls
and improving performance.
* docs: simplify .claude docs - replace verbose README with one-line CLAUDE.md
* refactor: remove redundant GITHUB_TOKEN export
Only GH_TOKEN is needed - gh CLI uses it, and gh auth setup-git
configures git to use gh credentials
* refactor: remove internal timeout - rely on external timeout
No need for duplicate timeout mechanisms
* Add retry logic to PR merges in e2e tests
GitHub's mergeability computation can take a few seconds after base
branch changes, causing transient "not mergeable" errors. Instead of
updating the branch before merging (as was done in install-gh-cli branch),
add retry logic to handle these transient failures gracefully.
* Add references explaining why merge retry is needed
* Simplify merge_pr_with_retry calls - set -e handles failure
* Restore wait_for_workflow changes: match by headBranch instead of eventPayload
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f7fc4b0 commit f79392b
1 file changed
Lines changed: 47 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
54 | 85 | | |
55 | 86 | | |
56 | 87 | | |
| |||
85 | 116 | | |
86 | 117 | | |
87 | 118 | | |
88 | | - | |
| 119 | + | |
89 | 120 | | |
90 | 121 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
110 | 135 | | |
111 | 136 | | |
112 | 137 | | |
| |||
268 | 293 | | |
269 | 294 | | |
270 | 295 | | |
271 | | - | |
| 296 | + | |
272 | 297 | | |
273 | 298 | | |
274 | 299 | | |
| |||
389 | 414 | | |
390 | 415 | | |
391 | 416 | | |
392 | | - | |
| 417 | + | |
393 | 418 | | |
394 | 419 | | |
395 | 420 | | |
| |||
0 commit comments