Skip to content

test: add integration tests for watch capabilities (#709)#868

Merged
diberry merged 2 commits intodevfrom
squad/709-watch-capability-tests
Apr 7, 2026
Merged

test: add integration tests for watch capabilities (#709)#868
diberry merged 2 commits intodevfrom
squad/709-watch-capability-tests

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 5, 2026

Summary

Adds 51 tests covering the 5 highest-risk watch capabilities that shipped in PR #709 with zero test coverage. This was flagged as 🟡 High priority in the architecture review.

Capabilities tested

Capability Tests Coverage
ExecuteCapability 16 buildAgentPrompt, findExecutableIssues edges, preflight, execute flow
CleanupCapability 11 preflight, round-skipping, scratch deletion, date-based pruning
DecisionHygieneCapability 7 preflight, threshold logic, timeout, missing inbox
SelfPullCapability 7 preflight, clean pull, stash/unstash, stash-pop failure
BoardCapability 2 preflight (gh project CLI check)

Closes #709

Copilot AI review requested due to automatic review settings April 5, 2026 19:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

🟢 Impact Analysis — PR #868

Risk tier: 🟢 LOW

📊 Summary

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

🎯 Risk Factors

  • 1 files changed (≤5 → LOW)
  • 1 module(s) touched (≤1 → LOW)

📦 Modules Affected

tests (1 file)
  • test/cli/watch-capabilities.test.ts

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 9e3185a

PR Scope: 🔧 Infrastructure

⚠️ 4 item(s) to address before review

Status Check Details
Single commit 2 commits — consider squashing before review
Not in draft Ready for review
Branch up to date dev is 3 commit(s) ahead — rebase recommended
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 0 active Copilot thread(s) resolved (1 outdated skipped)
CI passing 16 check(s) still running

Files Changed (1 file, +713 −0)

File +/−
test/cli/watch-capabilities.test.ts +713 −0

Total: +713 −0


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new vitest suite to cover the highest-risk squad watch capability plugins introduced in/around #709, improving confidence in preflight gating, filtering logic, and subprocess-driven flows without relying on real gh, git, or filesystem state.

Changes:

  • Adds a comprehensive watch-capabilities test suite covering Execute, Cleanup, Decision Hygiene, Self Pull, and Board capability behaviors.
  • Introduces shared mocks for SDK storage, child_process, and fs to keep tests deterministic.

Comment thread test/cli/watch-capabilities.test.ts
@diberry diberry force-pushed the squad/709-watch-capability-tests branch from 9e3185a to 9069171 Compare April 6, 2026 14:57
Add 51 tests covering 5 watch capabilities (execute, cleanup,
decision-hygiene, self-pull, board) that shipped with zero test
coverage in PR #709.

Test coverage:
- ExecuteCapability: buildAgentPrompt, findExecutableIssues edge cases,
  preflight, execute flow (adapter mock, agent dispatch, errors, timeouts)
- CleanupCapability: preflight, round-skipping, file pruning by date,
  stale inbox warnings, config validation
- DecisionHygieneCapability: preflight, threshold logic, merge trigger,
  timeout handling
- SelfPullCapability: preflight, git stash/fetch/pull flow, stash pop
  failure, source change detection
- BoardCapability: preflight checks

Closes #709

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/709-watch-capability-tests branch from 9069171 to 4f7a946 Compare April 6, 2026 16:08
Copy link
Copy Markdown
Collaborator

@tamirdresher tamirdresher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by @tamirdresher — reviewed diff, CI green, changes are clean and well-tested. cc @diberry

@diberry diberry merged commit 6ba4572 into dev Apr 7, 2026
11 checks passed
tamirdresher pushed a commit that referenced this pull request Apr 21, 2026
Add 51 tests covering 5 watch capabilities (execute, cleanup,
decision-hygiene, self-pull, board) that shipped with zero test
coverage in PR #709.

Test coverage:
- ExecuteCapability: buildAgentPrompt, findExecutableIssues edge cases,
  preflight, execute flow (adapter mock, agent dispatch, errors, timeouts)
- CleanupCapability: preflight, round-skipping, file pruning by date,
  stale inbox warnings, config validation
- DecisionHygieneCapability: preflight, threshold logic, merge trigger,
  timeout handling
- SelfPullCapability: preflight, git stash/fetch/pull flow, stash pop
  failure, source change detection
- BoardCapability: preflight checks

Closes #709

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner

Closed by #theSquadsquad triage — stale/answered, no further action needed.

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.

4 participants