loopguard: a PHPUnit or CTest run is judged without its summary, so a failing run can end a turn green
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 領域
- devtools, testing-qa
調査の方向性
Start with tokeneconomizer/loopguard/turn.py and trace how VERIFY_RE and runner_verdict handle PHPUnit and CTest output; the reproduction in the issue gives four cases to check. The issue links open pull request #355, so the work is already under way.
索引モデルが issue の本文から書いたものです。
説明
tokeneconomizer/loopguard/turn.py counts phpunit and ctest as test runs (VERIFY_RE), but runner_verdict knows neither runner's summary. When a later command replaces a run's exit status (ctest; git status, phpunit | tail -3), the guard judges the run by the runner's summary, and with none it falls back to the last command's status or to the output's error markers (state.ERR_RE). So a failing PHPUnit or CTest run followed by another command, or a PHPUnit run that only errored, behind a pipe, counts as passed, and the turn as ended green. That feeds the per-repository envelope a turn whose tests failed. The other way round, a passing CTest run behind a pipe counts as failed, since ERR_RE's case-insensitive FAILED matches its 0 tests failed.
The summaries, from each runner's source: PHPUnit (src/TextUI/Output/SummaryPrinter.php; DefaultResultPrinter.php in 9.6) prints OK (3 tests, 5 assertions) for a pass, which runner_verdict already reads, OK, but there were issues!, OK, but some tests were skipped! (9.6: OK, but incomplete, skipped, or risky tests!) for a pass with skips or issues, and FAILURES! or ERRORS! above its Tests: N, Assertions: N, ... counts for a failure. CTest (Source/CTest/cmCTestTestHandler.cxx) prints 67% tests passed, 1 tests failed out of 3, or 100% tests passed, 0 tests failed out of 3 when none failed (100% tests passed out of 3 on CMake's master branch).
Reproduction (offline):
from tokeneconomizer import loopguard
from tokeneconomizer.loopguard import turn
cases = [
("vendor/bin/phpunit; git status --short", "FAILURES!\nTests: 3, Assertions: 5, Failures: 1.\n"),
("vendor/bin/phpunit 2>&1 | tail -3", "ERRORS!\nTests: 3, Assertions: 2, Errors: 1.\n"),
("ctest --test-dir build; git status --short", "67% tests passed, 1 tests failed out of 3\n"),
("ctest --test-dir build | tail -3", "100% tests passed, 0 tests failed out of 3\n"),
]
for cmd, out in cases:
g = loopguard.TurnGuard(turn_key="t")
g.fold("Edit", {"file_path": "src/a.c", "old_string": "x", "new_string": "y"}, "ok")
g.fold("Bash", {"command": cmd}, out, 0)
print(f"{cmd:45} verdict={turn.runner_verdict(out)} ended_green={g.resolved_proxy()}")
Expected: the three failing runs read verdict=True ended_green=False, and the passing CTest run verdict=False ended_green=True.
Actual:
vendor/bin/phpunit; git status --short verdict=None ended_green=True
vendor/bin/phpunit 2>&1 | tail -3 verdict=None ended_green=True
ctest --test-dir build; git status --short verdict=None ended_green=True
ctest --test-dir build | tail -3 verdict=None ended_green=False
Upstream main: 747b8016538c13da7ba9d455b89e5e6595bf5294
Python 3.13.18, Linux
- 主要言語
- Python
- スター
- 7.4k
- フォーク
- 500
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 123
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/TokenEconomizer のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/TokenEconomizer#360 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
microskills: bundle exec and pnpm exec are recorded as bundle run and pnpm run対応中かも @Shizoqua が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/TokenEconomizer#344 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
microskills: a command wrapped in bash -lc or zsh -lc is not observed対応中かも @Shizoqua が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/TokenEconomizer#343 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
README: state the minimum Python version next to the test instructions対応中かも @rahul05ranjan が 4 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/TokenEconomizer#328 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
trace: the usage a Pi tool reports on its own result is left out of the session's usage対応中かも @Shizoqua が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
microsoft/TokenEconomizer#352 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
microsoft/TokenEconomizer の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
reasons-gate
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
benthomasson/reasons-service#190 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 3 日以内に返信