Skip to content

fix(hooks): report one count per runner in the Stop test lines - #177

Merged
furedea merged 2 commits into
mainfrom
fix/one-count-per-runner
Nov 12, 2026
Merged

furedea merged 2 commits into
mainfrom
fix/one-count-per-runner

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

概要

Stop 時のテスト行を,どの runner でも <N> passed[, <F> failed][, <S> skipped|ignored] の 1 つの件数にする.

runner 変更前 変更後
rust test result: 行を test binary ごとに連結(14 行・約 1000 文字) 全行の passed / failed / ignored を合算
node TAP(npm / pnpm / yarn / bun test を含む) # tests など 6 行を連結 # pass / # fail / # skipped / # todo から 1 行
vitest / jest Tests 行をそのまま 同じ表記に正規化(todo は skipped に加算)
go / pytest / bats 変更なし 変更なし
  • 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

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]>
@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T04:27:02.474514Z decaddc Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread agents/hooks/lib/check_evidence.py Outdated
from dataclasses import dataclass

ANSI = re.compile(r"\x1b\[[0-9;]*[A-Za-z]")
TAP_FOOTER = re.compile(r"^# (pass|fail|skipped|todo) (\d+)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread agents/hooks/lib/check_evidence.py Outdated
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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

レビュー概要

ブロッキングな指摘(P0/P1)はない.executed は従来どおり passed + failed で計算されている.executed == 0 による UNAVAILABLE / SKIPPED の判定も壊れていない.

P2(2 件,inline コメント参照)

  • node TAP の # cancelled が読まれなくなった.タイムアウトしたテストが件数行から消える.
  • JS の Tests 行は最初の 1 行だけが使われる.workspace をまたぐ npm test などで実行が複数回あると,2 回目以降の失敗が件数に出ない.rust 側はすべての行を合算しているので,扱いがそろっていない.

どちらもテストの fixture が足りない(cancelled を含む TAP,Tests 行が複数ある出力).

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +110 to +112
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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Node の既定 spec reporter も集計する

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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@furedea

furedea commented Nov 12, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

レビュー結果

ブロッキングな指摘はありません(P0/P1: 0 件,P2/P3: 0 件).

確認した点:

  • Counts.tally の戻り値注釈 -> Counts は from __future__ import annotations がありませんが,requires-python >= 3.15.2 なので注釈の遅延評価(PEP 649)により問題ありません.
  • rust の executed は従来どおり passed + failed で,ignored は含まれません.test result: 行がなければ test count unavailable / None のままです.
  • Tests 行の検出が vitest / jest 以外のラベル(npm / pnpm / yarn test)にも効くようになりましたが,これらのラベルで jest / vitest を起動する場合も同じ表記で集計されるため,望ましい挙動です.
  • node TAP / spec のフッターは pass / fail / cancelled のいずれかがある場合だけ集計され,No tests found は従来どおり executed=0 です.
  • 追加テストは rust の複数 binary の合算,TAP / spec,cancelled,jest の複数回実行,skipped と todo の扱い,認識できない出力をカバーしています.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: decaddc60f

ℹ️ 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".

@furedea
furedea merged commit 0f36b82 into main Nov 12, 2026
27 checks passed
@furedea
furedea deleted the fix/one-count-per-runner branch November 12, 2026 04:35
furedea pushed a commit that referenced this pull request Nov 12, 2026
🤖 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): Stop のテスト行を runner ごとに 1 つの件数にする

1 participant