Skip to content

test: fix stale assertions breaking npm test on main#5549

Merged
lpcox merged 1 commit into
mainfrom
fix/npm-test-stale-assertions
Jun 25, 2026
Merged

test: fix stale assertions breaking npm test on main#5549
lpcox merged 1 commit into
mainfrom
fix/npm-test-stale-assertions

Conversation

@lpcox

@lpcox lpcox commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Problem

npm test was failing on main with 5 failures across 5 suites — two unrelated bits of test rot that landed with recent merges:

  1. src/commands/main-action.test.tscleanup() gained a 9th agentImage parameter in the rootless perm-fixer work (Fix rootless firewall artifact permissions to prevent EACCES on upload #5546), but the toHaveBeenCalledWith assertion still expected only 8 args (received a trailing undefined).
  2. 4 workflow lock tests (security-guard, self-hosted-runner-doctor, test-coverage-improver, self-hosted-runner-doctor-updater) — pinned github/gh-aw-actions/setup@3c7f3b6f… # v0.81.0, but the committed .lock.yml files were upgraded to @b5cde6c… # v0.81.2.

Fix

  • Add the trailing STUB_CONFIG.agentImage arg to the cleanup call assertion.
  • Update the setup action pin in the 4 workflow tests to b5cde6c5013569c8b0229dd2d7ffd63eaf2c9ad2 # v0.81.2 to match the regenerated lock files.

Test-only changes; no runtime/source code touched.

Verification

npm test3211 passed, 182 suites, 0 failures.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Two unrelated stale-test failures had landed on main:

- main-action.test.ts: cleanup() gained a 9th agentImage parameter
  (rootless perm-fixer, #5546) but the call assertion still expected
  8 args. Add the trailing agentImage arg.
- 4 workflow lock tests pinned setup@3c7f3b6f (v0.81.0); the lock
  files were upgraded to setup@b5cde6c (v0.81.2). Update the pins.

All 3211 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 25, 2026 23:50
@lpcox lpcox merged commit 2c84c7b into main Jun 25, 2026
23 checks passed
@lpcox lpcox deleted the fix/npm-test-stale-assertions branch June 25, 2026 23:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes test rot on main by updating stale Jest assertions to match recent signature and workflow-lock pin changes, restoring npm test green without touching runtime code.

Changes:

  • Update main-action unit test to assert the new cleanup() argument list (including agentImage).
  • Update 4 workflow lockfile tests to expect the current pinned github/gh-aw-actions/setup commit SHA (b5cde6c… # v0.81.2).
Show a summary per file
File Description
src/commands/main-action.test.ts Adjusts cleanup call assertion to include the newly-added agentImage argument.
scripts/ci/test-coverage-improver-workflow.test.ts Updates expected setup action pin to match regenerated lock workflow SHA/version.
scripts/ci/self-hosted-runner-doctor-workflow.test.ts Updates expected setup action pin SHA used in the lock workflow.
scripts/ci/self-hosted-runner-doctor-updater-workflow.test.ts Updates expected setup action pin SHA used in the lock workflow.
scripts/ci/security-guard-workflow.test.ts Updates expected setup action pin to match regenerated lock workflow SHA/version.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Low

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 98.24% 98.28% 📈 +0.04%
Statements 98.17% 98.21% 📈 +0.04%
Functions 99.53% 99.53% ➡️ +0.00%
Branches 94.29% 94.29% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

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.

2 participants