Require test evidence for SDK source changes#108
Open
zoeshawwang wants to merge 2 commits into
Open
Conversation
Coverage thresholds do not see omitted modules such as integration and server, so SDK source changes need an explicit per-change evidence gate. Wire the gate into coverage and a PR workflow, requiring matching unit and e2e test changes for each changed agentrun source file. Constraint: GitHub Python SDK repository uses repository-root paths, not monorepo python/ paths. Rejected: Relying on global or incremental coverage alone | coverage omits important SDK directories and is not per-file enforcement. Confidence: high Scope-risk: moderate Directive: Keep coverage thresholds and this evidence gate separate; omitted coverage files still need unit and e2e evidence. Tested: uv run --python 3.10 --all-extras isort scripts/check_test_evidence.py tests/unittests/test_quality_gate.py Tested: uv run --python 3.10 --all-extras pyink --config pyproject.toml scripts/check_test_evidence.py tests/unittests/test_quality_gate.py Tested: uv run --python 3.10 --all-extras pytest tests/unittests/test_quality_gate.py Tested: uv run python scripts/check_test_evidence.py simulated missing/unit-only/e2e-only/unit-plus-e2e cases Change-Id: I6241b508960ee114f344ca2de5302c3fbdd80b92 Not-tested: Full make coverage on the GitHub checkout; the change was validated with targeted gate tests and simulations. Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
The CI mypy step scans the repository root and the new tests import the gate as scripts.check_test_evidence. Without a package marker, mypy sees scripts/check_test_evidence.py under two module names and exits before coverage can run. Constraint: Existing CI runs make mypy-check before make coverage on every push. Rejected: Excluding scripts from mypy | the quality gate code should remain type-checkable with the rest of the repository. Confidence: high Scope-risk: narrow Directive: Keep scripts/__init__.py if tests import repository scripts as package modules. Tested: make mypy-check Tested: uv run pytest tests/unittests/test_quality_gate.py Tested: make coverage Change-Id: I5b894dbaa5ae23181833827ab277d68be380f39d Not-tested: GitHub-hosted CI rerun is pending after push. Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
96c9185 to
1b9122e
Compare
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
agentrun/**/*.pyfilesagentrun/integration/*andagentrun/server/*make coverageand a dedicated PR workflowValidation
uv run --python 3.10 --all-extras isort scripts/check_test_evidence.py tests/unittests/test_quality_gate.pyuv run --python 3.10 --all-extras pyink --config pyproject.toml scripts/check_test_evidence.py tests/unittests/test_quality_gate.pyuv run --python 3.10 --all-extras pytest tests/unittests/test_quality_gate.py