test: fix stale assertions breaking npm test on main#5549
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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-actionunit test to assert the newcleanup()argument list (includingagentImage). - Update 4 workflow lockfile tests to expect the current pinned
github/gh-aw-actions/setupcommit 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
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
npm testwas failing onmainwith 5 failures across 5 suites — two unrelated bits of test rot that landed with recent merges:src/commands/main-action.test.ts—cleanup()gained a 9thagentImageparameter in the rootless perm-fixer work (Fix rootless firewall artifact permissions to prevent EACCES on upload #5546), but thetoHaveBeenCalledWithassertion still expected only 8 args (received a trailingundefined).security-guard,self-hosted-runner-doctor,test-coverage-improver,self-hosted-runner-doctor-updater) — pinnedgithub/gh-aw-actions/setup@3c7f3b6f… # v0.81.0, but the committed.lock.ymlfiles were upgraded to@b5cde6c… # v0.81.2.Fix
STUB_CONFIG.agentImagearg to thecleanupcall assertion.setupaction pin in the 4 workflow tests tob5cde6c5013569c8b0229dd2d7ffd63eaf2c9ad2 # v0.81.2to match the regenerated lock files.Test-only changes; no runtime/source code touched.
Verification
npm test→ 3211 passed, 182 suites, 0 failures.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com