Skip to content

chore: fix test import drift — 38 collection errors from renamed/removed internal symbols #725

Closed

Description

@vybe

Summary

38 test collection errors and 7 additional failures stem from tests that import internal symbols that were renamed or removed during recent refactors. These prevent the affected test files from loading at all, silently dropping ~45 tests from the suite. All six symbol groups need to be identified and either the symbols restored/re-exported, or the tests updated to the new API surface.

Context

Full test suite run on 2026-05-08. Six distinct import drift groups identified:

Symbol Module Tests Affected
`list_all_agents_fast` `services.docker_service` `test_github_pat_propagation_unit.py` (11 tests)
`check_login_rate_limit`, `record_login_attempt`, `get_redis_client` `routers.auth` `unit/test_login_rate_limit_split.py` (10 tests) + `test_ip_rate_limit_fix.py` (2 tests)
`AgentDefaultResourcesUpdate` `models` `unit/test_telegram_webhook_backfill.py` (4 tests)
`Query`, `status` `fastapi` (via monitoring router) `unit/test_fleet_status_resilience.py` (7), `unit/test_sync_health_service.py` (7), `unit/test_webhook_rate_limit_inprocess.py` (1)
`AgentClient` `services.agent_client` `unit/test_agent_readiness_probe.py` (5 tests)
`get_agent_default_resources` unknown (settings service?) 5 tests

Additionally, three files excluded at collection time:

Acceptance Criteria

  • All 6 import drift groups resolved (symbols re-exported or tests updated to new API)
  • `unit/test_monitoring_router_signatures.py` and `unit/test_skill_service_user_agent.py` collection errors fixed
  • Zero collection errors in `pytest --collect-only` output (excluding intentionally skipped files)
  • The ~45 previously uncollected tests now run and pass (or are explicitly marked skip with reason)

Technical Notes

  • For symbols like `Query`/`status`: likely the monitoring router switched from `from fastapi import Query, status` to `from fastapi import Query` + `from starlette import status` — tests that mock `routers.monitoring.Query` need the new import path
  • For `check_login_rate_limit` etc.: these may have moved to a rate-limiting middleware or utility module — trace where the login rate-limit logic lives now
  • For `AgentClient`: check if it was renamed to something like `AgentHTTPClient` or merged into another service
  • Prefer updating tests over adding re-export shims — these tests are white-box unit tests and should import from where the symbol actually lives
  • Run `pytest --collect-only 2>&1 | grep "ImportError"` to get the full current list before starting

Activity

  1. vybe commented on May 8, 2026

    @vybe
    ContributorAuthor

    /claim

  2. added
    status-in-progress
    on May 8, 2026
  3. github-actions commented on May 8, 2026

    @github-actions

    Claimed by @vybe. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/725-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #725
  4. added
    status-in-dev
    and removed
    status-in-progress
    on May 8, 2026
  5. vybe commented on Jun 1, 2026

    @vybe
    ContributorAuthor

    Shipped in v0.6.0 (released via #998).

  6. added
    theme-devex
    and removed
    status-in-dev
    on Jun 1, 2026
  7. added a commit that references this issue on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority-p2theme-devextype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions