Skip to main content
在 Manus 中运行任何 Skill
一键导入

worktree-historical-test-replay-missing-dirs

星标2
分支0
更新时间2026年7月8日 12:17

Fix `pytest exit 4` ("file or directory not found") when running a test command in a git worktree checked out at an OLD commit. Use when: (1) you're doing historical replay (incident replay, mutation testing, git bisect with tests) and the suite errors out in 1-2 seconds with no test execution, (2) the test command works fine at HEAD but fails at pre-fix SHAs, (3) `pytest scripts/overnight/tests/ goal/tests/ --tb=no -q` returns "ERROR: file or directory not found: scripts/overnight/tests/" at an old SHA, (4) you're building tooling that runs the project's canonical test command across multiple historical SHAs. The fix is NOT to add the missing dir back — it didn't exist then. The fix is to filter the test-dir list at each SHA to only those that exist in that commit's tree, then invoke pytest with the filtered list. If none survive, classify the SHA as "unrunnable" rather than failing the whole replay.

安装

用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。

SKILL.md
readonly