Skip to content

Commit bd02348

Browse files
author
Abel Milash
committed
Add test coverage and JUnit XML reporting to CI pipelines
1 parent 5a395ec commit bd02348

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

.azdo/ci-pr.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,18 @@ extends:
6666
displayName: 'Install wheel'
6767
6868
- script: |
69-
pytest
69+
pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing
7070
displayName: 'Test with pytest'
7171
7272
- task: PublishTestResults@2
7373
condition: succeededOrFailed()
7474
inputs:
75-
testResultsFiles: '**/test-*.xml'
75+
testResultsFiles: '**/test-results.xml'
7676
testRunTitle: 'Python 3.12'
7777
displayName: 'Publish test results'
78+
79+
- task: PublishCodeCoverageResults@2
80+
condition: succeededOrFailed()
81+
inputs:
82+
summaryFileLocation: '**/coverage.xml'
83+
displayName: 'Publish code coverage'

.github/workflows/python-package.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,18 @@ jobs:
5151
5252
- name: Test with pytest
5353
run: |
54-
pytest
54+
pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing
55+
56+
- name: Upload test results
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: test-results
61+
path: test-results.xml
62+
63+
- name: Upload coverage report
64+
if: always()
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: coverage-report
68+
path: coverage.xml

0 commit comments

Comments
 (0)