Mutation gate job mixes its self-test's CI-format output lines with real findings

オープン 初心者向け
#2,717 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
github-actions, node.js, typescript

調査の方向性

pnpm test:mutation-ci を実行するセルフテストの手順と、scripts/stryker-diff.mjs での出力処理を読む。テストが GitHub Actions のワークフローコマンド構文を含むフィクスチャ出力をどのように取得して表示するかを確認し、提案された対処法から1つ選ぶ。セルフテストを分離する、フィクスチャの行を明確に示す、または成功したテストの出力を抑制する。ゲート成功時のログにフィクスチャの警告が実際の検出結果のように表示されなくなり、セルフテスト失敗時には引き続き有用な診断情報が得られる状態を完了とする。

索引モデルが issue の本文から書いたものです。

説明

What happened

In a mutation-diff job log, four lines look like gate findings but come from the workflow's own passing test suite:

  • L1045 # ::warning title=Mutation test advisory::core Stryker preflight could not start: spawnSync /tmp/stryker-launch-Fw8RbA/node_modules/.bin/stryker ENOENT
  • L1046 # ::warning file=packages/core/src/value.ts,line=1,title=Mutation test advisory::packages/core/src/value.ts:1: Survived BooleanLiteral mutant (replacement: false). See the job summary for the complete list ...
  • L1048 # ::warning title=Mutation test advisory::Could not write the job summary: EISDIR: illegal operation on a directory, open '/tmp/stryker-summary-J1Taa7'
  • L1049 # ::warning title=Mutation test advisory::manifest advisory

All four sit inside the earlier step Run pnpm test:mutation-ci (its log group opens at L1028, its output ends at L1841), interleaved with its own fixture output - e.g. L1040 # Switched to a new branch 'feature'. Each of those strings occurs exactly once in the whole 1,894-line log.

The step that actually failed is the next one, L1842 Run BASE_SHA="$(git rev-parse "$HEAD_SHA^1")" followed by node scripts/stryker-diff.mjs ci --base "$BASE_SHA" --head "$HEAD_SHA". Its entire output is a single line:

L1852 Mutation gate failed: extension has 675 changed executable lines (limit 500). Split the PR or obtain a maintainer-reviewed narrow exclusion.
L1853 ##[error]Process completed with exit code 1.

So the ENOENT / EISDIR / Survived BooleanLiteral text is not the failure cause: it is the tool's own self-test talking in GitHub-workflow syntax, and it is describing its own fixtures. The only ##[error] in the whole log is the one above, after the sizing step; the self-test step produced none and the job proceeded past it, which is how we know those tests passed.

The synthetic survivor is another tell worth keeping in mind: packages/core/src/value.ts is not a file the pull request changes at all (the pull request in question touches 58 files and packages/core/* is not among them), yet the fixture prints a surviving mutant for it with line=1.

Why it matters

Two independent agent lanes read this same log and both mis-triaged it, in the same direction: one concluded "the red is a Stryker start defect (ENOENT + EISDIR), no cap was hit"; the other first mistook self-test titles such as fails rather than skipping a package over the changed-line cap for failure lines. Neither conclusion was reachable from annotations alone, and neither was reachable without re-reading the primary artifact and mapping ##[group] step boundaries. A reader who only looks at annotations is unaffected; a reader pointed at the job log - which is where a failing step sends everyone - is misled.

Measured limit of the damage: because those lines are printed with a # prefix, GitHub did not register them as annotations (the annotations endpoint for that check run returns exactly one item, the exit-code line). The cost is log legibility, not a wrong surface on the pull request.

Reproduction

Every run of the gate executes this self-test step first, so the fixture text is always in the log. Evidence pointers from one such run: job 139687440390 in run 45753763067 (log 148,723 B / 1,894 lines); the identical gate message and the identical count 675 appear on an earlier head of the same branch in job 133379246289 (2026-11-16).

What would fix it

Options in rough order of cost:

  1. Run the self-tests in their own job, or at least a step whose name makes their output obviously unrelated to findings.
  2. Stop the self-test harness from emitting workflow-command-shaped payloads (::warning title=...::...) into the step's stdout. The escaping that prevents annotation registration is already in place; what is missing is anything that marks those lines as fixture output rather than findings.
  3. Print self-test output only when it fails, so a green self-test step contributes nothing to the log a triager reads.

Source order, for whoever prices the gate

scripts/stryker-diff.mjs sizes the delta first (selectFromGit -> buildManifest, whose cap throw is at lines 265-269 with MAX_CHANGED_LINES = 500 at line 11) and only then launches Stryker (runManifest, invoked at line 858). The prefix Mutation gate failed: is printed only by the catch at line 865. That is why "Stryker never started" is a consequence of the size gate, not an independent defect - and it is the fact a log reader has to reconstruct from source today.

主要言語
TypeScript
スター
2k
フォーク
301
平均マージ
3日 14時間
マージ済み PR(30日)
103

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Zoo-Code-Org/Zoo-Code のほかの issue

Zoo-Code-Org/Zoo-Code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。