logo
0
0
WeChat Login

test(scaffold): 补 13 个测试消除 #12 覆盖率退步(94%→98%)+ 棘轮阈值上调#31

Merged
created 2 weeks ago
main
feature/go-renderer-coverage-ratchet
Edit
OverviewCommits
2
Files changed
3
Attachments

新增测试类:

ModuleSpecValidationTests(4 个测试,覆盖 types.py 67-70):

  • test_valid_spec_passes
  • test_empty_module_name_raises
  • test_invalid_field_in_spec_propagates(for 循环向上抛异常分支)
  • test_empty_fields_list_is_valid

GoRendererImportHelperTests(8 个测试,覆盖 go_echo_sqlx 107/109-110/138→141):

  • test_stdlib_only_fields → 覆盖 107: stdlib.add(pkg)
  • test_third_party_only_fields → 第三方分组验证
  • test_no_fields_returns_empty → for 循环 0 次路径
  • test_extra_stdlib_added → 109-110: if extra + stdlib
  • test_extra_third_party_added → 109-110: if extra + third
  • test_extra_mixed_stdlib_and_third
  • test_deduplication_across_fields_and_extra
  • test_entity_with_datetime_field_dedups_time_import → 138→141 分支
  • test_entity_without_datetime_still_imports_time → 138 补加路径

测试数 32 → 45(+13),零实现代码改动。

棘轮阈值同步上调(scripts/ci/check-coverage.sh):
LINE_MIN 87 → 88
BRANCH_MIN 84 → 86
CORE_MIN 94 → 98

实测值与保底完全对齐:
#10 行覆盖率 88%
#11 行+分支 86%
#12 核心业务 98%(从 94%⚠️ 推回,超过长期目标 95%)
renderers/types.py 80% → 100%
renderers/go_echo_sqlx.py 95% → 100%

双解释器(bash 严格 + dash POSIX)验证 7/7 脚本全绿。

派生自 meta-principles.md §原则 3(棘轮质量阈值——本 commit 是
'补测试→上调阈值'的一次完整演绎)+ §原则 2(可执行测试的负价值原则
反向演练——本轮修复的 go_echo_sqlx 覆盖率漏洞正是 PR #27 没贯彻
此原则的遗留)

Refs: CHECKPOINT §五 T-01(闭环)、§四 轮次 6

is using the merge method to merge into69214a7f
合并来自 feature/go-renderer-coverage-ratchet 的合并请求 #31

Successfully merged and closed

branch can be safely deleted
Reviewer
None yet
Assignee
None yet
Label
None yet
Participant