Skip to content

Require test evidence for SDK source changes#108

Open
zoeshawwang wants to merge 2 commits into
mainfrom
codex/sdk-quality-gates
Open

Require test evidence for SDK source changes#108
zoeshawwang wants to merge 2 commits into
mainfrom
codex/sdk-quality-gates

Conversation

@zoeshawwang
Copy link
Copy Markdown
Collaborator

Summary

  • add an SDK test evidence gate for changed agentrun/**/*.py files
  • require matching unit test and E2E test evidence in the same PR, including coverage-omitted modules such as agentrun/integration/* and agentrun/server/*
  • wire the gate into make coverage and a dedicated PR workflow

Validation

  • uv run --python 3.10 --all-extras isort scripts/check_test_evidence.py tests/unittests/test_quality_gate.py
  • uv run --python 3.10 --all-extras pyink --config pyproject.toml scripts/check_test_evidence.py tests/unittests/test_quality_gate.py
  • uv run --python 3.10 --all-extras pytest tests/unittests/test_quality_gate.py
  • simulated source-only, unit-only, e2e-only, and unit+e2e changed-file cases

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>
@zoeshawwang zoeshawwang force-pushed the codex/sdk-quality-gates branch from 96c9185 to 1b9122e Compare May 27, 2026 15:40
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.

2 participants