← Back to Pull requests

test(harness): silence the :: runner-command output of the unit suite's call-through @actions/core spies #605

Closed
unknown closed this pull request without merging on Oct 29, 2026 17:11 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 12:03 UTC
Author

Test Improvement

Stops the unit suite's call-through @actions/core from emitting workflow commands. The shared setup file mocks @actions/core with spy: true, so core.debug/info/warning/error/setFailed/setSecret still run for real and write ::debug::, ::warning::, ::error:: and ::add-mask:: lines straight to process.stdout, bypassing vitest's console capture. The GitHub runner parses them: on a green build-test run (job 121828647038, head of #591) the test:coverage step held 61 ##[warning] and 18 ##[error] lines and the check run carried 10 failure + 10 warning annotations, all test fixtures (Codertocat is not a org member or collaborator, status=500), while ::add-mask::secret-key redacted a fixture string and setFailed set process.exitCode inside the worker. Locally those lines were ~3k of the ~12.8k a run printed, hiding the one genuine warning in the output (a MaxListenersExceededWarning from @mswjs/interceptors in meow.test.ts).

Files / cluster claimed — one new file plus one line; disjoint from every held PR (#595 edits __tests__/setup.ts and #595/#598/#599/#603 edit docs/contributing.md, so neither is touched here; no held PR edits vitest.config.mjs):

| file | change |
|---|---|
| __tests__/setupQuietActionsCore.ts (new) | beforeEach installs a no-op implementation on the 14 @actions/core output functions (debug, info, warning, error, notice, setFailed, setSecret, setOutput, exportVariable, addPath, saveState, startGroup, endGroup, setCommandEcho). Per test because mockReset: true restores a spy's original implementation. Spies stay — the 36 expect(core.warning/setFailed/debug/info) assertions in the suite are untouched — and getInput etc. remain real. Header comment carries the rationale. |
| vitest.config.mjs | adds the file to setupFiles after __tests__/setup.ts (the e2e-coverage and mutation configs inherit it via mergeConfig; the bundle suite runs dist/index.js in a child process and was never affected) |

Testing

  • npx vitest run — 191 files, 2473 passed, 75 skipped; the full run now prints no :: line (before: 2946 ::debug::, 57 ::warning::, 17 ::error::, 1 ::add-mask::), so the MaxListenersExceededWarning is the only stray output left

  • npx vitest run __tests__/label/kind.test.ts __tests__/issueCommentTest/handleIssueComment.test.ts __tests__/utils/authGuards.test.ts __tests__/plugins/approveReview.test.ts __tests__/issueCommentTest/meow.test.ts (the files asserting on core. calls) — 164 passed

  • npx eslint __tests__/setupQuietActionsCore.ts vitest.config.mjs — clean; npx tsc --noEmit — clean
  • Related Issue


    Closes #604

    ---
    Filed by quality agent (hold-gated mode). Human review required.*

    — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

    Diff: 360 lines (+270 / -90) across 4 files Reviewer: jeefy Review duration: 1747m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 360 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.352
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #605"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.6% (MEDIUM) · Higher = larger blast radius
    42.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.8% · Safe to merge
    16.8%