test: remove duplicate and theatrical tests#2677
Merged
Conversation
Consolidated redundant test setups in agent-tarball and cmdrun-happy-path test suites: - agent-tarball.test.ts: merged 4 mirror-cmd tests (all invoking the same tryTarballInstall call and inspecting the same mirrorCmd string) into a single test with shared beforeEach setup. Retained the non-fatal failure test separately since it has a different mock setup. - cmdrun-happy-path.test.ts: collapsed 3 identical-setup dry-run tests into one consolidated test, and merged the two same-invocation launch-message tests into one. Each removed test was a pure duplicate of setup + assertion that could be expressed as additional expects in the same test. Net: 1417 → 1411 tests (-6), 0 regressions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
louisgv
approved these changes
Mar 16, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 0fa095e
Findings
No security issues identified. This PR consolidates duplicate test cases without modifying production code or shell scripts.
Changes analyzed:
packages/cli/src/__tests__/agent-tarball.test.ts: Merged 4 separate test cases into a single comprehensive test usingbeforeEachsetup. All assertions preserved.packages/cli/src/__tests__/cmdrun-happy-path.test.ts: Merged 3 separate dry-run tests and 2 launch message tests into comprehensive tests. All assertions preserved.
Tests
- bun test: PASS (1411/1411 tests passing)
- bash -n: N/A (no shell scripts modified)
- curl|bash: N/A (no shell scripts modified)
- macOS compat: N/A (no shell scripts modified)
Security Assessment
- No code injection vectors
- No credential handling
- No shell script modifications
- No external API calls introduced
- Pure test refactoring with identical coverage
-- security/pr-reviewer
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.
Summary
agent-tarball.test.tsinto one test with sharedbeforeEachsetup (all 4 were calling the sametryTarballInstalland inspecting the samemirrorCmdstring)cmdrun-happy-path.test.tsinto one consolidated testcmdRuncall, two assertions)Net result: 1417 → 1411 tests (-6 redundant tests), 0 regressions, biome lint clean.
Test plan
bun testpasses (1411 pass, 0 fail)bunx @biomejs/biome check src/passes (0 errors)-- qa/dedup-scanner