Skip to content

test(fork): auto-rebase precheck 的情境測試進 fork-check-lint - #79

Merged
audichuang merged 1 commit into
developfrom
fork-chore/precheck-scenario-test
Oct 26, 2026
Merged

audichuang merged 1 commit into
developfrom
fork-chore/precheck-scenario-test

Conversation

@audichuang

Copy link
Copy Markdown
Owner

為什麼

#77、#78 兩輪都靠臨時寫的情境測試抓到 precheck 的問題(develop-moved 時每小時重開一輪、長期失敗沒有警報)。precheck 改壞時排程只會安靜停擺,所以把那份測試正式放進 repo、掛進 fork-check-lint。

改了什麼

  • .claude/skills/orca-fork-auto-rebase/scripts/precheck.test.sh:暫存 HOME 裡放假的 git、gh 與警報腳本,跑 13 種情境(沒有鎖、等人的鎖被取代/仍有效/develop 已移動、發版中新鮮/過期、進行中新鮮/過期、gh 失敗 1/2/7 小時、怪 tag),比對 exit code 與有沒有警報。用 env -u BASH_ENV 跑:這台機器的 BASH_ENV 會依假 HOME 重排 PATH,讓真的 gh 排到假的前面。
  • precheck.sh:日期解析 BSD date -j 失敗時改用 GNU date -d,測試在 CI 的 Linux 上也能跑。
  • Makefile:fork-check-lint 跑這支測試。
  • FORK.md:說明這支測試,改 precheck 時要在這裡加情境。

驗證

  • 本機 13 個情境全過
  • Mutation:拿掉 develop-moved 判斷 →「releasing, fresh」紅;警報門檻改 10 小時 →「gh down 7 h」紅

🤖 Generated with Claude Code

precheck.test.sh runs precheck.sh against fake git, gh and alert script in a temp
HOME, one case per lock state plus the 6 h down alert; a broken precheck otherwise
stops the hourly rebase in silence. The precheck parses dates with BSD or GNU date
so the test also runs in Linux CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@audichuang
audichuang merged commit 73e8a87 into develop Oct 26, 2026
26 of 28 checks passed
@audichuang
audichuang deleted the fork-chore/precheck-scenario-test branch October 26, 2026 01:42
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