test: raise coverage to ~68% (runtime + session)#212
Merged
Conversation
20552db to
76793ee
Compare
radugheo
approved these changes
May 25, 2026
76793ee to
0771f83
Compare
|
There was a problem hiding this comment.
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
_sessionrelay primitives (_is_response, message id extraction, HTTP error paths, retry behavior). - Add additional tests for
_runtimeproperties, SignalR handlers, abort/cleanup paths, and_validate_authbranches.
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 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
_runtimeproperties, signalr handlers, abort/cleanup paths, validate_auth branches_sessionrelay primitives:_is_response, message id extraction, http error paths, retry behavior_runtime.pymoves from 28% to 44%,_session.pyfrom 19% to 65%, overall from 54% to 68%Why
second follow-up from #210, stacked on #211