Repository navigation
fix(test): isolate CLI fixtures for sanitized releases - #2541
Conversation
Use temporary project squads for status and doctor success scenarios so sanitized release checkouts do not depend on live repository state. Preserve the existing no-squad failure checks. Relates to #2540. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🟡 Impact Analysis — PR #2541Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedtests (6 files)
This report is generated automatically for every PR. See #733 for details. |
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ❌ | Copilot threads resolved | 1 unresolved Copilot thread(s) — fix and resolve before merging |
| ✅ | CI passing | All checks passing |
Files Changed (6 files, +25 −7)
| File | +/− |
|---|---|
test/acceptance/features/hostile-pipe-mode.feature |
+1 −0 |
test/acceptance/features/hostile-tiny-terminal.feature |
+2 −0 |
test/acceptance/hostile.test.ts |
+3 −2 |
test/acceptance/steps/cli-steps.ts |
+1 −1 |
test/acceptance/steps/hostile-steps.ts |
+5 −2 |
test/ux-gates.test.ts |
+13 −2 |
Total: +25 −7
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
There was a problem hiding this comment.
🟡 Changes recommended
The hostile acceptance suite still leaks temporary squad directories because its fixtures bypass the shared cleanup tracker, leaving an active teardown issue to resolve.
1 open issue
What changed in this PR
This test-only PR makes CLI status and doctor acceptance tests independent of the repository's live .squad/ directory by using isolated project fixtures and propagating their working directories through terminal handlers.
Changes:
- Creates isolated squad fixtures for UX and hostile acceptance scenarios.
- Tracks initialized acceptance fixtures for cleanup and extends terminal-size waits for doctor diagnostics.
- Hostile-specific temporary fixtures still require cleanup registration to prevent directory leaks.
| File | Description |
|---|---|
| test/ux-gates.test.ts | Runs the status UX test against an isolated temporary squad project. |
| test/acceptance/steps/hostile-steps.ts | Passes fixture working directories through hostile terminal handlers and extends the terminal-size timeout. |
| test/acceptance/steps/cli-steps.ts | Tracks initialized acceptance project directories for teardown cleanup. |
| test/acceptance/hostile.test.ts | Cleans tracked acceptance fixtures after hostile scenarios, but does not yet clean directly created hostile fixtures. |
| test/acceptance/features/hostile-tiny-terminal.feature | Uses isolated initialized project squads for status and doctor scenarios. |
| test/acceptance/features/hostile-pipe-mode.feature | Uses an isolated initialized project squad for the piped status scenario. |
Review effort: Lite (adaptive)
| if (rapidHarnesses) { | ||
| await Promise.all(rapidHarnesses.map(h => h.close())); | ||
| } | ||
| cleanupAcceptanceTempDirs(); |

What
Make status and doctor success scenarios use isolated project squads instead of the repository's live
.squad/directory. Only six test and feature files change.Why
Relates to #2540. Removing internal team state from the release tree exposed four failing assertions. The no-squad errors introduced by #2279 are correct and remain unchanged.
How
Give the UX status test its own temporary squad. Reuse the initialized-project Given step for hostile status and doctor scenarios, pass its cwd through terminal-size and non-TTY handlers, and register those fixtures for cleanup. Allow the terminal-size handler 15 seconds because doctor can spend five seconds probing the Copilot CLI.
Validation used an independent clone of the sanitized promotion tree, not a linked worktree. Linked worktrees can resolve a squad from the main checkout and mask this regression. The clone had no root
.squad/before or after testing.SKIP_BUILD_BUMP=1 npm run build: passed on the sanitized product tree.npx --no-install vitest run test/ux-gates.test.ts test/acceptance/hostile.test.ts: passed, 37 tests and 2 existing todos.npx --no-install vitest run test/acceptance/acceptance.test.ts: passed, 25 tests.npm run lint: passed.npx --no-install eslint test/ux-gates.test.ts test/acceptance/hostile.test.ts test/acceptance/steps/cli-steps.ts test/acceptance/steps/hostile-steps.ts: passed.npm testand repository-wide ESLint were not run locally. Required CI must pass before merge.npx changeset add/.changeset/*.md, directCHANGELOG.mdentry for maintainers, orskip-changeloglabel for no user-facing changes)No SDK/CLI source or shipped templates changed; no changeset is required.
PR Readiness Checklist
Branch & Commit
dev(notmain)dev(git fetch upstream && git rebase upstream/dev)git diff --cached --stat)Build & Test
npm run buildpassesnpm testpasses (all tests green)npm run lintpasses (type check clean)npm run lint:eslintpassesThe full-suite checkboxes await CI. This is a six-file test-only fix, not a migration.
Changeset
npx changeset add(ifpackages/squad-sdk/src/orpackages/squad-cli/src/changed)CHANGELOG.mdentry (maintainers only — write-protected for external contributors)skip-changeloglabel applied (if no user-facing changes)N/A: no product-source changes.
Docs
N/A: product behavior and public capabilities are unchanged.
Exports
N/A.
Breaking Changes
None.
Waivers
None requested. Required CI must pass before merge.