Repository navigation
fix(hooks): report one count per runner in the Stop test lines - #177
Conversation
Sum every cargo test result line and fold node TAP, vitest and jest outcomes into the shared N passed[, F failed][, S skipped] form. Refs #176 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| from dataclasses import dataclass | ||
|
|
||
| ANSI = re.compile(r"\x1b\[[0-9;]*[A-Za-z]") | ||
| TAP_FOOTER = re.compile(r"^# (pass|fail|skipped|todo) (\d+)") |
There was a problem hiding this comment.
[P2] TAP_FOOTER no longer reads # cancelled. The old code put that line in the summary as-is. The node test runner counts timed-out tests (and subtests cancelled when their parent fails) under # cancelled, not under # fail. So a run with # pass 2 / # fail 0 / # cancelled 1 now shows only 2 passed. The status is still FAILED, but the count line hides why. Consider adding cancelled to the failed count (or showing it separately), and add a fixture with # cancelled 1.
There was a problem hiding this comment.
Fixed in decaddc: cancelled is now read from the TAP footer and counted as failed. Added a fixture with cancelled 1 that reports 2 passed, 1 failed.
| observed.append(int(match[1])) | ||
| return Evidence("; ".join(summaries) or "test count unavailable", sum(observed) if observed else None) | ||
| if re.match(r"^\s*Tests[:\s]", line): | ||
| return Counts.tally(re.findall(r"(\d+) (passed|failed|skipped|todo)\b", line)).evidence() |
There was a problem hiding this comment.
[P2] This returns on the first Tests line, while summarize_rust adds up every test result: line. An npm test / pnpm test / yarn test script that runs jest or vitest more than once prints one Tests line per run (for example npm test --workspaces, pnpm -r test, or jest && vitest). Only the first run is reported. Failures from later runs disappear from the count, e.g. 5 passed next to status FAILED. The old code kept every line. Suggest tallying all matching lines, the same way the rust and TAP paths do.
There was a problem hiding this comment.
Fixed in decaddc: every Tests line is now tallied, like the rust and TAP paths. Added a fixture with two jest runs that reports 7 passed, 1 failed.
レビュー概要ブロッキングな指摘(P0/P1)はない. P2(2 件,inline コメント参照)
どちらもテストの fixture が足りない(cancelled を含む TAP, 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3559d7bace
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| footer = [(match[2], match[1]) for match in map(TAP_FOOTER.match, lines) if match] | ||
| if any(outcome in {"pass", "fail"} for _, outcome in footer): | ||
| return Counts.tally(footer).evidence() |
There was a problem hiding this comment.
Node 23 以降のプロジェクトではこの TAP footer が存在しません.このリポジトリの選択処理は node --test に --test-reporter=tap を付けずに実行しますが,Node 23 では非 TTY 出力の既定 reporter も TAP から spec に変更されました(Node.js test runner documentation).その出力は ℹ pass 1 のようになるため footer が空になり,成功した node suite が常に test count unavailable/executed=None と表示されて,この変更が意図する単一件数を報告できません.呼び出し側で TAP reporter を明示するか,spec footer も解析してください.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in decaddc: the footer pattern now accepts the spec reporter prefix as well as the TAP one. Added a fixture built from the TAP footer with the info symbol, which reports 3 passed, 1 failed, 1 skipped.
Treat node cancelled tests as failed, sum every vitest/jest Tests line, and read the node spec reporter footer as well as the TAP one. Refs #176 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
レビュー結果ブロッキングな指摘はありません(P0/P1: 0 件,P2/P3: 0 件). 確認した点:
🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🤖 I have created a release *beep* *boop* --- ## [0.1.2](v0.1.1...v0.1.2) (2026-11-12) ### Features * **hooks:** add Go and Rust model rules with eval fixtures ([#158](#158)) ([9731488](9731488)) * **hooks:** show model-rule timing and skip rule fixtures ([#157](#157)) ([d0c32ae](d0c32ae)) * **hooks:** show the model rules as one result line with cost ([#170](#170)) ([41b9033](41b9033)) ### Bug Fixes * **hooks:** allow a jq filter after read-only GraphQL queries ([#180](#180)) ([cfb80d8](cfb80d8)) * **hooks:** keep model-rule eval fixtures out of Stop test verification ([#160](#160)) ([a4f1c6c](a4f1c6c)) * **hooks:** read paths literally in every jev-lint child process ([#173](#173)) ([0d2c683](0d2c683)) * **hooks:** remove model-rule false positives with principles and eval fixtures ([#163](#163)) ([b07fc4e](b07fc4e)) * **hooks:** report one count per runner in the Stop test lines ([#177](#177)) ([0f36b82](0f36b82)) * **hooks:** take the model-rule cached count from the dry-run plan ([#167](#167)) ([c87fdfd](c87fdfd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: furedea-release[bot] <353651101+furedea-release[bot]@users.noreply.github.com>
概要
Stop 時のテスト行を,どの runner でも
<N> passed[, <F> failed][, <S> skipped|ignored]の 1 つの件数にする.test result:行を test binary ごとに連結(14 行・約 1000 文字)# testsなど 6 行を連結# pass/# fail/# skipped/# todoから 1 行Tests行をそのままexecutedは従来どおり passed + failed(skipped / ignored / todo は含めない).test count unavailable(executedは None)のまま.Counts値オブジェクトにまとめ,表記とexecutedの算出を 1 か所にした.検証
uv run --frozen pytest tests/hooks: 3741 passed, 1 skipped.runner の実出力形式を fixture にしたテストをtests/hooks/test_check_evidence.pyに追加した.Closes #176
🤖 Generated with Claude Code