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

Đang mở Phù hợp với người mới
#2,717 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, node.js, typescript
Lĩnh vực
ci-cd, devtools, testing

Hướng nghiên cứu

Đọc bước self-test chạy pnpm test:mutation-ci và cách xử lý đầu ra trong scripts/stryker-diff.mjs. Kiểm tra cách các bài kiểm thử thu thập và in đầu ra fixture chứa cú pháp lệnh workflow của GitHub, sau đó chọn một trong các biện pháp được đề xuất: tách riêng self-test, đánh dấu rõ các dòng fixture hoặc ẩn đầu ra của các bài kiểm thử đạt. Hoàn tất khi nhật ký của gate đạt không còn hiển thị cảnh báo từ fixture như thể đó là các phát hiện thực tế, trong khi self-test thất bại vẫn cung cấp thông tin chẩn đoán hữu ích.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
2k
Fork
301
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
103

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Zoo-Code-Org/Zoo-Code

Tất cả issue của Zoo-Code-Org/Zoo-Code

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.