fix(api): 修复 CI 移除后遗留的孤儿门禁测试#34
Merged
Merged
Conversation
test_e2e_workflow_migration_gate.py 仍在 read_text() 读取已删除的
.github/workflows/{ci,e2e}.yml,导致全量 pytest 因 FileNotFoundError 红灯
(741 passed / 2 failed)。
改写为守护当前门禁真相源:CI 保持移除(无远程 workflow 冒充验证门禁)+
本地 .githooks/pre-push 持续覆盖 lint 与 OpenAPI 漂移。原 e2e.yml 迁移预检
顺序断言随 CI 删除一并移除(其守护目标已不存在)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
问题
全量
uv run pytest红灯(741 passed / 2 failed):两者均为
FileNotFoundError:测试在read_text()读取.github/workflows/{e2e,ci}.yml,而这两个文件已随 CI 整体移除(#30 → #31 → #33)删除,.github/目录已不存在。该守卫测试是 CI 移除时漏删的孤儿,导致逐项 targeted 测试全绿但全量门禁红灯,违反「所有变更后套件保持绿」的横切 DoD。修复
把该文件改写为守护当前门禁真相源,保留原测试「远程 CI 不得替代本地验证门禁」的意图:
test_ci_removed_no_remote_workflow_acts_as_validation_gate:断言.github/workflows不复存在;若未来重新引入远程 workflow 必须显式更新本守卫。test_local_pre_push_hook_is_the_lint_and_drift_gate:断言.githooks/pre-push跑pnpm run verify:fast,且verify:fast持续覆盖lint+check:drift(OpenAPI 漂移)。原
e2e.yml迁移预检顺序断言随 CI 删除一并移除——其守护目标(远端 e2e workflow)已不存在,本地不再有等价对象可断言。验证
uv run pytest tests/test_e2e_workflow_migration_gate.py -q→ 2 passed;ruff check通过。uv run pytest复跑确认 743 passed / 3 skipped / 0 failed。pnpm run verify:fast(lint + OpenAPI 漂移)经 pre-push hook 通过。范围
仅 1 个测试文件(+30 / −21)。不含本地工作区中正在进行的 Q/P 质量/产品轨改动。
🤖 Generated with Claude Code