Skip to content

feat: Add pytest coverage comment to PRs#548

Merged
Roopan-Microsoft merged 2 commits intodevfrom
psl-add-coverage-pr-comment
Apr 20, 2026
Merged

feat: Add pytest coverage comment to PRs#548
Roopan-Microsoft merged 2 commits 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 for backend tests to improve test reporting and provide automated coverage feedback on pull requests. The main changes involve updating permissions and integrating a new step to comment test coverage results directly on pull requests.

Workflow improvements:

  • Added pull-requests: write permission to the workflow to allow posting comments on pull requests.

Test reporting enhancements:

  • Modified the pytest command in the backend test job to generate a JUnit XML report (--junitxml=pytest.xml) in addition to coverage reports.
  • Added a new step using MishaKav/pytest-coverage-comment to automatically post a coverage summary as a comment on pull requests, but only when the PR is not from a fork and 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>
Updated pytest command and coverage paths to match dev's new test
structure (src/tests/ContentProcessor/). Added --junitxml=pytest.xml
and MishaKav coverage comment step with corrected paths.

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

Coverage

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

Tests Skipped Failures Errors Time
242 0 💤 0 ❌ 0 🔥 3.662s ⏱️

@Roopan-Microsoft Roopan-Microsoft merged commit 68529d4 into dev Apr 20, 2026
6 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.

2 participants