test: raise code coverage to ~98% for MER KPI (PRODEV-612) - #233
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds additional unit tests to significantly increase overall code coverage (targeting ~98%) for the CLI runtime and utility modules, without changing any production source code.
Changes:
- Added a new test suite for
_diagnose.diagnose_binarycovering OS/arch and subprocess error branches. - Added new async tests for
_token_refresh.TokenRefreshercovering lifecycle, refresh loop behavior, and both OAuth/client-credentials flows. - Added new async tests for
_sessionand_runtimeto cover additional relay/consume paths and HTTP-process lifecycle/cleanup/keep-alive branches.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_diagnose.py |
New unit tests for binary diagnostics helper, including Linux ELF/readelf and non-Linux file-command branches. |
tests/cli/test_token_refresh_more.py |
Expanded async coverage for token refresh strategies, loops, retries, and refresh implementations. |
tests/cli/test_session_more.py |
Added session-server tests for relay/consume loops and start/run error-handling paths. |
tests/cli/test_runtime_extra.py |
Added broad runtime tests for HTTP server process management, registration, cleanup, and keep-alive behaviors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PopescuTudor
force-pushed
the
mer/increase-coverage
branch
from
July 29, 2026 12:08
2a010da to
73d82ec
Compare
Add unit tests to lift SonarCloud main-branch coverage from 65.6% to ~98%, clearing the 80% MER "Increase Code Coverage" guardrail (PRODEV-612). - tests/test_diagnose.py: full coverage of the binary diagnostics helper (previously 0%, untested). - tests/cli/test_token_refresh_more.py: refresh loop, oauth/client-credentials flows, lifecycle, and retry/cancel paths. - tests/cli/test_session_more.py: relay loop, consumer drain/error paths, stdio/http run flows and start-error handling. - tests/cli/test_runtime_extra.py: HTTP process lifecycle, monitor, cleanup, registration (stdio + streamable-http), run-server orchestration, keep-alive. No source changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PopescuTudor
force-pushed
the
mer/increase-coverage
branch
from
July 29, 2026 14:26
73d82ec to
82e4884
Compare
|
edis-uipath
approved these changes
Jul 29, 2026
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.



Why
MER KPI #10 "Increase Code Coverage" (PRODEV-612) is red: SonarCloud main-branch coverage was 65.6%, below the 80% guardrail.
What
Adds unit tests to lift SonarCloud main-branch coverage from 65.6% → ~98% (local: 1177 stmts, 19 missed = 98.39%). No source changes.
tests/test_diagnose.py_diagnose.pytests/cli/test_token_refresh_more.py_token_refresh.pytests/cli/test_session_more.py_session.pytests/cli/test_runtime_extra.py_runtime.pyVerification
uv run pytest— 203 passeduv run mypy— no issuesuv run ruff check ./ruff format --check .— cleanFollow-ups (not in this PR)
mainbranch protection so coverage can't regress (as done for the sibling SDK repos).sonarProjectKeys: UiPath_uipath-mcp-python.🤖 Generated with Claude Code