Skip to content

Commit 4027c5e

Browse files
authored
Python: Fix Python test coverage report workflow (#12261)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Our Python test coverage workflow has been failing due to a breaking in the text format of the test coverage output: MishaKav/pytest-coverage-comment#202. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> This PR fixes the issue by switching to xml. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent f5017a1 commit 4027c5e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/python-test-coverage-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
with:
4444
github-token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
4545
issue-number: ${{ env.PR_NUMBER }}
46-
pytest-coverage-path: python/python-coverage.txt
46+
pytest-xml-coverage-path: python/python-coverage.xml
4747
title: "Python Test Coverage Report"
4848
badge-title: "Python Test Coverage"
4949
junitxml-title: "Python Unit Test Overview"

.github/workflows/python-test-coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
- name: Install the project
3737
run: uv sync --all-extras --dev
3838
- name: Test with pytest
39-
run: uv run --frozen pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered ./tests/unit | tee python-coverage.txt
39+
run: uv run --frozen pytest -q --junitxml=pytest.xml --cov=semantic_kernel --cov-report=term-missing:skip-covered --cov-report=xml:python-coverage.xml ./tests/unit
4040
- name: Upload coverage report
4141
uses: actions/upload-artifact@v4
4242
with:
4343
path: |
44-
python/python-coverage.txt
44+
python/python-coverage.xml
4545
python/pytest.xml
4646
python/pr_number
4747
overwrite: true

0 commit comments

Comments
 (0)