Skip to content

fix(tests): repair failing unit-tests on main (RESPX /v1/teams mock)#289

Merged
mvillmow merged 1 commit into
mainfrom
fix/respx-teams-mock
Jun 29, 2026
Merged

fix(tests): repair failing unit-tests on main (RESPX /v1/teams mock)#289
mvillmow merged 1 commit into
mainfrom
fix/respx-teams-mock

Conversation

@mvillmow

Copy link
Copy Markdown
Contributor

Problem

The required unit-tests check has been consistently FAILING on main (not flaky), which blocks all ~19 open PRs.

Root cause: the executor's idempotency snapshot step now calls GET /v1/teams via AgamemnonClient.list_teams() (executor.py:118), but the integration test RESPX router in tests/integration/conftest.py never registered that route. Every workflow run therefore errored with:

RESPX: <Request('GET', 'http://mock-agamemnon/v1/teams')> not mocked!

The workflow then failed and the assertions failed. The CI unit-tests job runs the full suite (pixi run pytest --tb=short -q --cov=telemachy --cov-report=term-missing), so these integration tests run under it.

This affected 6 tests across test_error_scenarios.py and test_full_workflow.py.

Fix

  • Add the missing GET /v1/teams mock route (list_teams) to the conftest RESPX router, mirroring list_agents and returning {"teams": [...]} to match the real API shape. (Resolves the /v1/teams not mocked failures — the primary issue.)
  • Update test_full_workflow.py agent-payload assertions for the workflow-scoped idempotency keys added in Add workflow idempotency keys to prevent duplicate provisioning #253: the create-agent payload name now carries the tlm-<hash>-<agent> idempotency key while label stays the human-readable name, and the docker payload includes hostId. The tests now assert on the stable label / name suffix instead of the stale raw name. (Same regression wave; fixtures weren't updated.)
  • Remove stray .claude-followup-177.md agent artifact that leaked onto main (was failing the non-required markdownlint check; not referenced anywhere).

Verification (local)

  • pixi run pytest --tb=short -q --cov=telemachy --cov-report=term-missing (exact CI unit-tests command) → 148 passed
  • pixi run ruff check src tests → All checks passed
  • pixi run mypy src/telemachy --ignore-missing-imports → Success, no issues

This unblocks all open Telemachy PRs once merged. Squash-merge only.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

🤖 Generated with Claude Code

… idempotency-key payloads)

The executor's idempotency snapshot step now calls GET /v1/teams via
AgamemnonClient.list_teams() (executor.py:118), but the integration test
RESPX router in tests/integration/conftest.py never registered that route,
so every workflow run errored with "RESPX: GET /v1/teams not mocked!" and
the unit-tests CI job (pixi run pytest, full suite) failed on main, blocking
all open PRs.

- Add the missing GET /v1/teams mock route (list_teams), mirroring
  list_agents and returning {"teams": [...]} to match the real API shape.
- Update test_full_workflow.py agent-payload assertions for the
  workflow-scoped idempotency keys added in #253: `name` now carries the
  tlm-<hash>-<agent> key while `label` stays the human-readable name, and
  the docker payload includes hostId. Assert on the stable `label`/suffix
  instead of the old raw `name`.
- Remove stray .claude-followup-177.md agent artifact that leaked onto main
  (failed non-required markdownlint; not referenced anywhere).

Restores the unit-tests check to green locally (148 passed, ruff + mypy clean).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
@mvillmow mvillmow enabled auto-merge (squash) June 29, 2026 01:06
@mvillmow mvillmow merged commit 27a7374 into main Jun 29, 2026
12 of 13 checks passed
@mvillmow mvillmow deleted the fix/respx-teams-mock branch June 29, 2026 02:30
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