Python: Enforce package coverage by lifecycle - #7261
Merged
Evan Mattson (moonbox3) merged 3 commits intoJul 23, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ae5ad8e-6b66-41b3-a862-4e2a3fae1cd0
Eduard van Valkenburg (eavanvalkenburg)
requested a review
from a team
as a code owner
July 22, 2026 14:24
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
July 22, 2026 14:24 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
July 22, 2026 14:24 — with
GitHub Actions
Inactive
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
July 22, 2026 14:24 — with
GitHub Actions
Inactive
Copilot started reviewing on behalf of
Eduard van Valkenburg (eavanvalkenburg)
July 22, 2026 14:25
View session
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Python coverage gate to enforce the documented 85% line-coverage threshold based on each distribution’s lifecycle (Development Status classifier), rather than a manually maintained allowlist. It also updates CI wiring/docs and expands tests across multiple Python packages to meet the newly enforced policy.
Changes:
- Replaced the coverage allowlist gate with a lifecycle-driven checker (
.github/scripts/python_check_coverage.py) that aggregates Cobertura coverage bypython/packages/<dist>/...directory and enforces 85% for non-exempt Beta+ packages. - Updated GitHub Actions workflows to run the new checker and added focused automation tests for the checker itself.
- Added/expanded unit tests across several Python packages (tools, redis, monty, hyperlight, durabletask, chatkit, bedrock) to close gaps exposed by the new enforcement.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
python/packages/tools/tests/test_shell_resolve.py |
Adds more unit coverage for shell resolution (env override, platform defaults, helper functions). |
python/packages/tools/tests/test_shell_killtree.py |
New tests for process-tree termination helpers across psutil/stdlib paths. |
python/packages/tools/tests/test_local_shell_tool.py |
Expands LocalShellTool coverage (env handling, stateless runner behavior, Windows process group kwargs). |
python/packages/tools/tests/test_docker_shell_tool.py |
Adds broader DockerShellTool unit tests around mode behavior, policy denial, session/container lifecycle, and timeouts. |
python/packages/redis/tests/test_context_provider_edges.py |
Adds edge-case coverage for RedisContextProvider (schema, filtering, pagination, validation). |
python/packages/monty/tests/monty/test_monty_codeact.py |
Expands coverage for instruction builders, mount helpers, file capture, truncation behavior, and provider delegation. |
python/packages/hyperlight/tests/hyperlight/test_hyperlight_codeact.py |
Adds tests for normalizers/shape guards, instruction builders, and provider delegation. |
python/packages/durabletask/tests/test_workflow_runner_context.py |
New tests for CapturingRunnerContext behavior and reset semantics. |
python/packages/durabletask/tests/test_workflow_orchestrator_helpers.py |
New unit tests for orchestrator helper functions (task prep/routing, HITL serialization/dispatch, fan-in). |
python/packages/durabletask/tests/test_workflow_dt_context.py |
New tests for DurableTaskWorkflowContext adapter behavior. |
python/packages/durabletask/tests/test_async_bridge.py |
New tests for the durabletask async bridge loop/thread lifecycle and coroutine execution. |
python/packages/chatkit/tests/test_converter.py |
Expands ThreadItemConverter coverage across more ChatKit item variants (quoted text, tags, widgets, tool calls, dispatch). |
python/packages/bedrock/tests/test_bedrock_client.py |
Adds significant coverage for BedrockChatClient session creation, request prep, tool-result handling, and parsing helpers. |
python/packages/azurefunctions/tests/test_workflow_af_context.py |
New tests for Azure Functions workflow-context adapter and wrapper orchestration entrypoint. |
python/packages/azurefunctions/tests/test_func_utils.py |
Adds extra unit coverage for CapturingRunnerContext no-ops and request-info tracking. |
python/DEV_SETUP.md |
Documents the lifecycle-based 85% enforcement policy and exemptions. |
python/.github/skills/python-testing/SKILL.md |
Updates testing guidance to reflect lifecycle-based enforcement and recommends extending existing test files. |
.github/workflows/python-test-coverage.yml |
Wires coverage checking to the new script and updates the workflow’s path filters/step naming. |
.github/workflows/python-check-coverage.py |
Removes the old allowlist-based coverage gate script. |
.github/workflows/github-automation-tests.yml |
Adds a Python job step to run the new checker’s unit tests in CI. |
.github/tests/test_python_check_coverage.py |
Adds automation tests validating lifecycle policy loading, aggregation, and pass/fail behavior. |
.github/scripts/python_check_coverage.py |
Introduces the lifecycle-driven coverage enforcement implementation used by CI. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ae5ad8e-6b66-41b3-a862-4e2a3fae1cd0
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
July 22, 2026 14:56 — with
GitHub Actions
Inactive
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ae5ad8e-6b66-41b3-a862-4e2a3fae1cd0
Eduard van Valkenburg (eavanvalkenburg)
temporarily deployed
to
github-app-auth
July 22, 2026 15:04 — with
GitHub Actions
Inactive
Tao Chen (TaoChenOSU)
approved these changes
Jul 22, 2026
Tao Chen (TaoChenOSU)
left a comment
Contributor
There was a problem hiding this comment.
Approving but the workflow builder changes need Evan Mattson (@moonbox3) to greenlight
Evan Mattson (moonbox3)
approved these changes
Jul 23, 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.
Motivation & Context
Python coverage enforcement used a manually maintained target allowlist, allowing many Beta packages to fall below the documented 85% threshold without failing CI. This makes package maturity and coverage policy drift apart as packages are added or promoted.
Description & Review Guide
.github/scripts, gained focused automation tests, and package tests were expanded where the new gate exposed coverage gaps.Related Issue
Fixes #7260
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.