Skip to content

feat: Add pytest coverage comment to PRs#816

Open
Rafi-Microsoft wants to merge 1 commit intodevfrom
psl-add-coverage-pr-comment
Open

feat: Add pytest coverage comment to PRs#816
Rafi-Microsoft wants to merge 1 commit intodevfrom
psl-add-coverage-pr-comment

Conversation

@Rafi-Microsoft
Copy link
Copy Markdown
Contributor

Add MishaKav/pytest-coverage-comment action to post code coverage summary as a PR comment. Changes include:

  • Add pull-requests: write permission
  • Add --junitxml=pytest.xml flag for test summary
  • Add coverage comment step with per-file breakdown

Purpose

This pull request updates the GitHub Actions workflow to improve test reporting for pull requests. The main changes are the addition of automated coverage comments on pull requests and updates to permissions to support this feature.

CI workflow improvements:

  • Added pull-requests: write permission to the workflow to allow posting comments on pull requests.
  • Added a new step to run the MishaKav/pytest-coverage-comment GitHub Action, which posts test coverage summaries as comments on pull requests. This step is conditionally executed only for non-fork pull requests and when backend tests are not skipped.
  • Updated the pytest command to generate a junitxml report (pytest.xml), which is required as input for the coverage comment action.

Does this introduce a breaking change?

  • Yes
  • No

Add MishaKav/pytest-coverage-comment action to post code coverage
summary as a PR comment. Changes include:
- Add pull-requests: write permission
- Add --junitxml=pytest.xml flag for test summary
- Add coverage comment step with per-file breakdown

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL768137895% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
419 0 💤 0 ❌ 0 🔥 13.912s ⏱️

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.

1 participant