[quality] Nothing verifies the unit test each v8-ignore hint in src/ says drives its arm; add a static guard over the 25 hints
维护者通常 2 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- github-actions, typescript
调研方向
Start with the existing tests under tests and the v8 ignore hints in src/**/*.ts; the issue names tests/coverageIgnoreHints.test.ts as the proposed entry point. Add a static guard run by npm test that checks hint reasons, cited test files and imports, and test-only hooks against their callers. Confirm it catches the listed fault injections; issue 601 is an open linked pull request.
由索引模型根据 Issue 内容生成。
描述
Finding
src/ carries 25 /* v8 ignore */ hints in 11 files (main @ 9acb046): 7 arm-level ignore next hints and 6 ignore start/stop blocks around the test-only reset*() hooks. Every arm-level hint was added for the bundle run (npm run test:coverage:e2e), where the arm is unreachable from dist/index.js, and each one records that a unit test still drives the arm — … unreachable from dist/index.js; configSweep.test.ts drives it.
Nothing checks that second half. @vitest/coverage-v8 5.0.5 honours the same hints in the unit run (same provider; node_modules/@vitest/coverage-v8/dist/provider.js:171 adds only vite-internal ignoreNode rules and exposes no option to disable source hints), so the arm is invisible to both floors. Demonstration on main @ 9acb046:
npx vitest run --coverage \
--exclude __tests__/utils/configBlunderbussDelay.test.ts \
--exclude __tests__/utils/configSweep.test.ts \
--exclude __tests__/run.test.ts
# Test Files 188 passed, every threshold passes
# config.ts | 100 | 99.61 | 100 | 100 | 669
The two tests the hints at config.ts:619 and config.ts:679 name are gone, yet config.ts still reports 100 % lines and statements and neither 619 nor 679 is listed as uncovered. The only visible loss (669) is an unrelated branch configSweep.test.ts also covered. The same holds for auth.ts:18/20, command.ts:25, requireMatchingLabel.ts:169, run.ts:42 and lgtm.ts:68 (whose hint names no test at all; __tests__/label/lgtm.test.ts:796 drives it through the dispatcher). A future refactor that drops or rewrites one of those tests leaves a genuinely untested arm with a 100 % figure beside it.
This is a test-infrastructure gap, not a coverage gap: today every hinted arm is unit-covered (verified by reading each cited test), and the Stryker harness (stryker.config.mjs) does not cover these files or run in CI, so it is not a gate for this class either.
Recommendation
Add a static guard, __tests__/coverageIgnoreHints.test.ts, run by the ordinary npm test, that walks src/**/*.ts and asserts for every hint:
- it states a reason after
--(a barestopis exempt; the reason lives on itsstart); - an
ignore nexthint names<name>.test.ts drives it, that file exists under__tests__/, and it imports the hinted module (from '../../src/utils/config'), so the hint cannot outlive its test.src/labels/lgtm.ts:68is recorded in a one-entry table inside the test (its driver reaches the arm viahandleIssueComment, and the comment text ships intodist/index.js, so renaming it there means repacking the bundle); the table itself is checked so a stale entry fails; - every
starthas astopin the same file, saystest-only hook, and everyexport functionbetween them is called by at least one test file — the hook can only be ignored while a test still uses it.
Fault injection on the proposed guard: deleting configBlunderbussDelay.test.ts → config.ts:619 names the unit test that drives the ignored arm fails; appending an uncited ignore next to sleep.ts → fails; renaming resetLabelCache → labeling.ts:91 is a test-only hook … called from a test fails; adding lgtm.test.ts drives it to lgtm.ts:68 without dropping the table entry → the table check fails. All 39 cases pass on main.
What the guard does not do, deliberately: it does not prove the cited test still reaches the arm (no provider option exists to run coverage with hints stripped; a vite plugin blanking the hint text in a second coverage config would, at the cost of a second full unit run). Decision taken by hive: ship the static guard now; the stripped-hints run is a follow-up only if the maintainers want it.
Priority
- Impact: medium (a 100 % figure can sit beside an untested arm on merge-decision code —
config.ts,auth.ts,requireMatchingLabel.ts) - Effort: low (one new test file, no
src/,dist/or docs change)
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 9acb046
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- 主要语言
- TypeScript
- 星标
- 132
- 派生
- 24
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 229
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cncf/prow-github-actions 的其他 Issue
-
[quality] worker.ts scheduled(), queue consumer and deferViaQueue run under no test (unit excludes the file; miniflare suite only drives fetch())可能已有人在做 @hivecommons-hive 于 1 天前认领。 未关闭agent/quality needs-kind stage/040-covered-by-pr testing
难度 3/5 1-2 天 新手友好度 35/100
cncf/prow-github-actions#629 · 1 条评论 ·
维护者通常 2 天内回复
-
[quality] Helm chart: ingress.yaml is rendered by no helm-unittest suite and by neither kind install; serviceaccount/configmap/service and the apiUrl, extraEnv, image.tag, create=false arms are unasserted可能已有人在做 @hivecommons-hive 于 1 天前认领。 未关闭agent/quality needs-kind stage/040-covered-by-pr testing
难度 2/5 1-3 小时 新手友好度 30/100
cncf/prow-github-actions#625 · 1 条评论 ·
维护者通常 2 天内回复
-
agent/quality needs-human needs-kind stage/045-needs-decision testing
难度 4/5 3-5 天 新手友好度 30/100
cncf/prow-github-actions#594 · 4 条评论 ·
维护者通常 2 天内回复
-
hive/advisory kind/cleanup needs-human stage/045-needs-decision
难度 5/5 一周以上 新手友好度 15/100
cncf/prow-github-actions#170 · 5 条评论 ·
维护者通常 2 天内回复
查看 cncf/prow-github-actions 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
Automattic/data-liberation-agent#1115 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
CSS enhancement good first issue
难度 2/5 1-3 小时 新手友好度 70/100
pychess/pychess-variants#2448 ·
维护者通常 1 天内回复
-
[architect] Stale planning/scratch files at repo root (COMPONENT_SPLIT_SUMMARY.md etc.) describe already-completed work可能已有人在做 @hivecommons-hive 今天认领。 未关闭agent/architect architecture help wanted stage/040-covered-by-pr tech-debt
难度 2/5 1-3 小时 新手友好度 85/100
kubestellar/console#24716 ·
维护者通常 1 天内回复
-
helm-knative-apply.sh fails with Helm 4可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area: triage theme: undefined
难度 2/5 1-3 小时 新手友好度 85/100
jhipster/generator-jhipster#35895 ·
维护者通常 1 天内回复