Skip to content

[codex] fix unit test coverage reporting#3314

Merged
WMC001 merged 1 commit into
developfrom
fix/test-coverage-on-cicd
Jun 27, 2026
Merged

[codex] fix unit test coverage reporting#3314
WMC001 merged 1 commit into
developfrom
fix/test-coverage-on-cicd

Conversation

@JasonW404

Copy link
Copy Markdown
Member

Summary

Fix the parallel unit-test runner so CI coverage reporting matches the pre-parallel behavior while preserving file-level parallel execution.

Root Cause

PR #3285 changed unit tests from serial --cov-append into per-file coverage data files followed by coverage combine. The new flow only checked that coverage.xml existed and did not fully restore the previous coverage API reporting behavior. The combine/xml phase also needed to consistently use test/.coveragerc without relying on an unsupported --rcfile placement for the installed coverage version.

Changes

  • Pass COVERAGE_RCFILE to coverage combine/xml so both phases use test/.coveragerc.
  • Restore COVERAGE_PROCESS_START in per-file pytest subprocesses.
  • Restore coverage API report validation after combine.
  • Restore HTML coverage output under test/coverage_html.
  • Restore unit-test summary output: total, passed, failed, pass rate.
  • Restore detailed failed test-file reporting.

Validation

  • python3 -m py_compile test/run_all_test.py
  • git diff --check
  • Full local CI setup matching workflow:
    • uv sync --extra data-process --extra test
    • uv pip install -e "../sdk[dev]"
  • Full local UT run completed before the coverage combine fix and produced all .coverage.* files.
  • Re-ran coverage combine/report against those files successfully: generated test/coverage.xml, emitted coverage report, total coverage about 78.8%.
  • Smoke test:
    • NEXENT_PYTEST_TARGETS='test/sdk/core/models/test_prompt_cache.py' NEXENT_PYTEST_WORKERS=1 NEXENT_PYTEST_FILE_TIMEOUT=120 backend/.venv/bin/python test/run_all_test.py
    • Passed and generated test/coverage.xml plus test/coverage_html/.

@JasonW404 JasonW404 changed the base branch from main to develop June 27, 2026 03:30
@JasonW404 JasonW404 marked this pull request as ready for review June 27, 2026 03:31
Copilot AI review requested due to automatic review settings June 27, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@WMC001 WMC001 merged commit 3b9ca72 into develop Jun 27, 2026
4 of 5 checks passed
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.

3 participants