Skip to content

Add integration test for get_suggestions#92

Merged
ColonistOne merged 1 commit into
mainfrom
test/suggestions-integration
Jul 11, 2026
Merged

Add integration test for get_suggestions#92
ColonistOne merged 1 commit into
mainfrom
test/suggestions-integration

Conversation

@ColonistOne

Copy link
Copy Markdown
Collaborator

What

Adds tests/integration/test_suggestions.py — a live-API integration test for the read-only GET /suggestions endpoint (ColonyClient.get_suggestions, added in #89).

Coverage

  • Envelopesuggestions / count / generated_at / cached / ttl_seconds / categories, plus count == len(suggestions) and the categories facet being a {category: count} map.
  • Per-item shapeid / kind / category / title / rationale / score / how_to_url, and the action block covering every agent surface (mcp_tool / mcp_args / api_method / api_path / api_body / sdk_method / sdk_args all present; api_method + api_path asserted load-bearing).
  • Filterslimit, category, and kinds each return only matching suggestions.
  • Async parityAsyncColonyClient.get_suggestions.

Defensive by design

  • The endpoint is server-gated behind a feature flag — a module-scoped fixture probes it once and skips the whole module cleanly on 403/404.
  • Suggestions are content-dependent — tests that need a concrete item skip when the account legitimately has zero suggestions.
  • Follows the existing tests/integration/ conventions: auto-skips without COLONY_TEST_API_KEY, and the conftest hook converts 429s to skips. Read-only GET, so it costs nothing from the write budgets.

Verified

  • Live (flag enabled): 9 passed.
  • Keyless checkout: 9 skipped — CI stays green (integration tree is -m "not integration" in CI).
  • ruff clean, mypy clean.

🤖 Generated with Claude Code

Covers the read-only GET /suggestions endpoint (added in #89) against the
live API:

- envelope shape: suggestions/count/generated_at/cached/ttl_seconds/categories
- per-item shape + the action block covering every agent surface
  (mcp_tool/api/sdk keys all present; api_method + api_path load-bearing)
- limit, category, and kinds filters
- async parity (AsyncColonyClient.get_suggestions)

The endpoint is server-gated behind a feature flag, so a module-scoped
fixture probes it once and skips cleanly on 403/404. Content-dependent
assertions skip when the account legitimately has zero suggestions.
Follows the tests/integration/ conventions (auto-skip without
COLONY_TEST_API_KEY, 429 -> skip via the conftest hook). Verified live:
9 passed; 9 skipped on a keyless checkout.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TRn9SBFGaxRwZbwRsKNJ7b
@ColonistOne ColonistOne merged commit 63238dc into main Jul 11, 2026
6 checks passed
@ColonistOne ColonistOne deleted the test/suggestions-integration branch July 11, 2026 08:14
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant