Skip to content

Comments

ci: add coverage report and summary to tests workflow (closes #3)#6

Merged
xingyaoww merged 6 commits intomainfrom
openhands/fix-issue-3-coverage
Aug 24, 2025
Merged

ci: add coverage report and summary to tests workflow (closes #3)#6
xingyaoww merged 6 commits intomainfrom
openhands/fix-issue-3-coverage

Conversation

@xingyaoww
Copy link
Collaborator

Summary

  • Add pytest-cov to dev dependencies
  • Update CI to run pytest with coverage and produce Cobertura XML (coverage.xml)
  • Add Code Coverage Summary action to generate a markdown/text summary and badge
  • Post the coverage summary as a sticky PR comment on pull requests
  • Upload coverage artifacts for inspection

Changes

  • pyproject.toml: add pytest-cov in dev dependencies
  • .github/workflows/tests.yml:
    • run pytest with --cov=openhands --cov-report=xml:coverage.xml --cov-report=term-missing
    • add irongut/CodeCoverageSummary@v1.3.0 step with badge output
    • add marocchino/sticky-pull-request-comment@v2 to comment results on PRs
    • upload coverage.xml and code-coverage-results.md as artifacts
    • trigger on both push and pull_request; set minimal permissions

Testing

  • Local: executed pytest with coverage to verify coverage.xml generation (tests currently fail in local env but coverage report generation is validated). CI workflow will generate and publish the summary regardless of test outcomes due to if: always() on reporting steps.

Docs

  • Not applicable.

Checklist

  • CI updated to produce a coverage report
  • Coverage summary included using Marketplace action
  • PR references the issue and will close it when merged

Closes #3

@xingyaoww can click here to continue refining the PR

… workflow\n\n- Add pytest-cov to dev dependencies\n- Generate Cobertura XML via pytest --cov-report xml\n- Post markdown summary and badge using irongut/CodeCoverageSummary\n- Comment coverage results on PRs\n\nCloses #3\n\nCo-authored-by: openhands <openhands@all-hands.dev>
openhands-agent and others added 2 commits August 24, 2025 20:36
…erate coverage.svg badge from coverage.xml in CI\n- Commit badge on push builds; upload badge artifact on PRs\n- Add coverage badge to README\n\nCo-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Health
. 100%
core 86%
core.runtime 86%
core.runtime.tools 100%
core.runtime.tools.execute_bash 100%
core.runtime.tools.str_replace_editor 89%
core.runtime.tools.str_replace_editor.utils 96%
Summary 91% (667 / 736)

@openhands-ai
Copy link

openhands-ai bot commented Aug 24, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Run tests

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #6 at branch `openhands/fix-issue-3-coverage`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@xingyaoww xingyaoww marked this pull request as ready for review August 24, 2025 21:00
@xingyaoww xingyaoww merged commit 36531f2 into main Aug 24, 2025
@xingyaoww xingyaoww deleted the openhands/fix-issue-3-coverage branch August 24, 2025 21:00
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.

Add coverage report for tests

2 participants