Skip to content

fix(test): isolate CLI fixtures for sanitized releases - #2541

Merged
tamirdresher merged 1 commit into
devfrom
squad/2540-isolate-cli-tests
Nov 19, 2026
Merged

tamirdresher merged 1 commit into
devfrom
squad/2540-isolate-cli-tests

Conversation

@tamirdresher

Copy link
Copy Markdown
Collaborator

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.

  • Before the fix: the requested two suites reproduced all four CI failures.
  • 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.
  • Full npm test and repository-wide ESLint were not run locally. Required CI must pass before merge.

⚠️ Quick Check

  • If SDK/CLI source files changed: completed the applicable Changeset step below (npx changeset add / .changeset/*.md, direct CHANGELOG.md entry for maintainers, or skip-changelog label for no user-facing changes)

No SDK/CLI source or shipped templates changed; no changeset is required.

PR Readiness Checklist

The PR readiness bot will validate these automatically after push.
Check each item before requesting review. See CONTRIBUTING.md for full details.

Branch & Commit

  • Branch created from dev (not main)
  • Branch is up to date with dev (git fetch upstream && git rebase upstream/dev)
  • Verified diff contains only intended changes (git diff --cached --stat)
  • PR is not in draft mode (mark ready when checks pass)
  • Commit history is clean (squash fixups before review)

Build & Test

  • npm run build passes
  • npm test passes (all tests green)
  • npm run lint passes (type check clean)
  • npm run lint:eslint passes
  • For migration PRs (>20 files): include test output summary in PR description

The full-suite checkboxes await CI. This is a six-file test-only fix, not a migration.

Changeset

  • Changeset added via npx changeset add (if packages/squad-sdk/src/ or packages/squad-cli/src/ changed)
  • Or direct CHANGELOG.md entry (maintainers only — write-protected for external contributors)
  • Or skip-changelog label applied (if no user-facing changes)

N/A: no product-source changes.

Docs

  • README section updated (if new feature/module)
  • Docs feature page (if new user-facing capability)

N/A: product behavior and public capabilities are unchanged.

Exports

  • package.json subpath exports updated (if new module)

N/A.


Breaking Changes

None.

Waivers

None requested. Required CI must pass before merge.

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>
Copilot AI adaptive review requested due to automatic review settings November 19, 2026 07:55
@github-actions

Copy link
Copy Markdown
Contributor

🟡 Impact Analysis — PR #2541

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 6
Files added 0
Files modified 6
Files deleted 0
Modules touched 1

🎯 Risk Factors

  • 6 files changed (6-20 → MEDIUM)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

tests (6 files)
  • test/acceptance/features/hostile-pipe-mode.feature
  • test/acceptance/features/hostile-tiny-terminal.feature
  • test/acceptance/hostile.test.ts
  • test/acceptance/steps/cli-steps.ts
  • test/acceptance/steps/hostile-steps.ts
  • test/ux-gates.test.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 7b42f36

PR Scope: 🔧 Infrastructure

⚠️ 2 item(s) to address before review

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.

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.

🟡 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();
@tamirdresher
tamirdresher merged commit 02f5738 into dev Nov 19, 2026
30 checks passed
@tamirdresher
tamirdresher deleted the squad/2540-isolate-cli-tests branch November 19, 2026 09:42
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