Skip to content

test: raise coverage above 90% (currently 32%) #210

@radu-mocanu

Description

@radu-mocanu

Context

sonarcloud was wired up in #206. current overall coverage is ~32% (1131 statements, 768 uncovered). target is >90%.

only one test file exists today: tests/test_token_refresh.py. everything else is untested.

Per-module breakdown

module stmts miss cover
_cli/_runtime/_runtime.py 414 299 27.78%
_cli/_runtime/_session.py 213 172 19.25%
_cli/_runtime/_tracer.py 126 110 12.70%
_cli/_runtime/_factory.py 65 44 32.31%
_cli/_runtime/_token_refresh.py 152 48 68.42%
_cli/_runtime/_context.py 16 6 62.50%
_cli/_runtime/__init__.py 8 3 62.50%
_cli/_utils/_config.py 73 49 32.88%
_cli/cli_new.py 47 36 23.40%
middlewares.py 4 1 75.00%

Suggested follow-up PRs

  • cli_new.py and _utils/_config.py — smallest surface, mostly file IO and templating, easy wins
  • _runtime/_factory.py — pure wiring of register_runtime_factory and the factory class
  • _runtime/_context.py + _runtime/__init__.py — small helpers, finish them off
  • _runtime/_token_refresh.py — already 68%, push remaining branches
  • _runtime/_session.py — needs an in-memory MCP session double; biggest mocking effort
  • _runtime/_runtime.py — the bulk; depends on session test infrastructure
  • _runtime/_tracer.py — OTEL span assertions

Notes

  • sonarcloud's new-code gate (default 80%) already blocks regressions on incoming PRs, so this can land incrementally without a big-bang test PR.
  • tracer + runtime tests will likely need an anyio/mcp.shared.memory based in-process MCP server fixture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions