Skip to content

feat: Add pytest coverage comment to PRs#877

Merged
Roopan-Microsoft merged 1 commit into
devfrom
psl-add-coverage-pr-comment
Apr 20, 2026
Merged

feat: Add pytest coverage comment to PRs#877
Roopan-Microsoft merged 1 commit into
devfrom
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 enhance test reporting and permissions. The most important changes are:

Workflow Permissions:

  • Added pull-requests: write permission to the workflow, allowing the workflow to post comments on pull requests.

Test Reporting and Automation:

  • Modified the backend test step to generate a pytest.xml file by adding the --junitxml=pytest.xml flag to the pytest command, enabling richer test result reporting.
  • Added a new step using the MishaKav/pytest-coverage-comment GitHub Action to automatically post a coverage summary as a comment on pull requests, but only for non-fork PRs where backend tests are not skipped.

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
TOTAL130414688% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
163 0 💤 0 ❌ 0 🔥 6.399s ⏱️

@Roopan-Microsoft Roopan-Microsoft merged commit d5ad80d into dev Apr 20, 2026
3 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.22.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants