Skip to content

goose: add unit tests for agent metadata helpers - #62

Merged
ashtom merged 3 commits into
entireio:mainfrom
KC1706:test-goose-agent-unit-tests
Sep 10, 2026
Merged

ashtom merged 3 commits into
entireio:mainfrom
KC1706:test-goose-agent-unit-tests

Conversation

@KC1706

@KC1706 KC1706 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #61.

What

Adds agents/entire-agent-goose/internal/goose/agent_test.go — the goose adapter previously had no agent_test.go, unlike the omp, kiro, and qwen adapters.

Coverage

Focused, behavior-preserving unit tests for the pure helpers in agent.go:

  • TestDetectUsesPath — Detect() reflects whether goose is on PATH (temp-dir + fake binary, mirroring the omp test).
  • TestGetSessionID — nil input returns ""; otherwise passes the hook session_id through.
  • TestFormatResumeCommand — asserts the exact goose session --resume --session-id <id> string.
  • TestInfoDeclaresGoosePreviewAndCapabilities — asserts ProtocolVersion, Name/Type, IsPreview: true, the four hook names, and the declared capability set.

Testing

go test ./...              # goose module, all pass
gofmt -l                   # clean
go vet ./internal/goose/   # clean

No production code changed — this only adds test coverage for existing behavior.

KC1706 and others added 2 commits August 25, 2026 14:49
The goose adapter had no agent_test.go, unlike the omp, kiro, and qwen
adapters. This adds focused coverage for the pure, deterministic helpers
in agent.go without changing any behavior:

- Detect() resolves the goose binary from PATH
- GetSessionID() is nil-safe and passes through the hook session_id
- FormatResumeCommand() builds the goose resume invocation
- Info() declares is_preview plus the goose hook names and capabilities

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The intended behavior is covered correctly; the noted duplicate test is non-blocking.

Pull request overview

Expands Goose adapter unit coverage for metadata and session helpers.

Changes:

  • Tests PATH-based detection and session ID extraction.
  • Verifies preview metadata, hooks, and capabilities.
  • Tests resume-command formatting.
File summaries
File Description
agents/entire-agent-goose/internal/goose/agent_test.go Adds focused helper tests.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread agents/entire-agent-goose/internal/goose/agent_test.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The tests accurately cover the intended existing behavior with no unresolved issues.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@ashtom
ashtom merged commit 1dd2f0a into entireio:main Sep 10, 2026
36 checks passed
@ashtom

ashtom commented Sep 10, 2026

Copy link
Copy Markdown
Member

@KC1706 Just merged, thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

goose: adapter has no agent_test.go unit coverage

3 participants