Skip to content

test: raise coverage to ~68% (runtime + session)#212

Merged
radu-mocanu merged 1 commit into
mainfrom
test/coverage-runtime
May 25, 2026
Merged

test: raise coverage to ~68% (runtime + session)#212
radu-mocanu merged 1 commit into
mainfrom
test/coverage-runtime

Conversation

@radu-mocanu
Copy link
Copy Markdown
Collaborator

@radu-mocanu radu-mocanu commented May 18, 2026

Summary

  • new tests for _runtime properties, signalr handlers, abort/cleanup paths, validate_auth branches
  • new tests for _session relay primitives: _is_response, message id extraction, http error paths, retry behavior
  • _runtime.py moves from 28% to 44%, _session.py from 19% to 65%, overall from 54% to 68%

Why

second follow-up from #210, stacked on #211

@radu-mocanu radu-mocanu force-pushed the test/coverage-runtime branch from 20552db to 76793ee Compare May 18, 2026 15:03
@radu-mocanu radu-mocanu changed the base branch from test/coverage-boost to main May 18, 2026 15:03
Copilot AI review requested due to automatic review settings May 25, 2026 10:57
@radu-mocanu radu-mocanu force-pushed the test/coverage-runtime branch from 76793ee to 0771f83 Compare May 25, 2026 10:57
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds new unit tests for the CLI runtime/session implementation to increase overall coverage (notably _runtime.py and _session.py) as a follow-up to the incremental coverage work in #210/#211.

Changes:

  • Add focused tests for _session relay primitives (_is_response, message id extraction, HTTP error paths, retry behavior).
  • Add additional tests for _runtime properties, SignalR handlers, abort/cleanup paths, and _validate_auth branches.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/cli/test_session.py New tests covering BaseSessionServer/Stdio/HTTP session server behaviors, including retries and HTTP error handling.
tests/cli/test_runtime_more.py New tests covering UiPathMcpRuntime properties, handler branches, and cleanup/abort-related paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/cli/test_session.py
Comment on lines +235 to +241
stdio_session._write_stream = MagicMock()
stdio_session._write_stream.send = AsyncMock()
msg = JSONRPCMessage(JSONRPCRequest(jsonrpc="2.0", id=1, method="m"))
await stdio_session._message_queue.put(msg)

task = asyncio.create_task(stdio_session._consume_messages())
await asyncio.sleep(0.05)
@radu-mocanu radu-mocanu merged commit 6271d28 into main May 25, 2026
25 checks passed
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.

3 participants