Repository navigation
test(cli): add Copilot CLI subprocess integration tests for SQUAD_TEAM_ROOT - #838
Conversation
🛫 PR Readiness Check
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 2 commits — consider squashing before review |
| ✅ | 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 | Changeset file found |
| ✅ | 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 | 12 check(s) still running |
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🟡 Impact Analysis — PR #838Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (1 file)
tests (1 file)
This report is generated automatically for every PR. See #733 for details. |
There was a problem hiding this comment.
Pull request overview
Adds an integration-style Vitest suite to validate SQUAD_TEAM_ROOT start-directory behavior (including the Copilot CLI bang-command “cwd differs” scenario) by exercising getSquadStartDir()-equivalent logic and resolveSquad() results.
Changes:
- Adds coverage for
SQUAD_TEAM_ROOTset / unset / empty-string behavior. - Adds
resolveSquad()scenarios for valid team roots, mismatchedcwd, and invalid/non-existent roots.
| const fakePath = join(tmpdir(), 'squad-nonexistent-' + Date.now()); | ||
| process.env['SQUAD_TEAM_ROOT'] = fakePath; | ||
|
|
There was a problem hiding this comment.
This test assumes fakePath does not exist, but join(tmpdir(), 'squad-nonexistent-' + Date.now()) can collide with an existing directory/file (e.g., leftover from a prior run), making the test flaky. Consider generating a guaranteed-nonexistent path (e.g., create a temp dir with mkdtempSync and immediately remove it, or append a random suffix and expect(existsSync(fakePath)).toBe(false) before calling resolveSquad).
3610dbc to
9afef5c
Compare
tamirdresher
left a comment
There was a problem hiding this comment.
✅ LGTM — Solid integration tests for SQUAD_TEAM_ROOT resolution. Proper temp dir setup/teardown.
Summary
Adds 8 integration tests in est/cli/team-root-resolution.test.ts verifying SQUAD_TEAM_ROOT env-var resolution across all scenarios:
Tests added
getSquadStartDir() env-var handling (3 tests)
resolveSquad() integration (3 tests)
Invalid SQUAD_TEAM_ROOT path (2 tests)
Context
PR #763 added \getSquadStartDir()\ + 2 tests in
ap-subprocess.test.ts, but there were no tests verifying SQUAD_TEAM_ROOT works across all resolution scenarios, and no tests simulating the Copilot CLI bang-command subprocess scenario where cwd differs from the interactive shell.
Test-only PR — no product code changes.
Closes #836
Related: PR #763, #835