File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ extends:
4242
4343 - script : |
4444 python -m pip install --upgrade pip
45- python -m pip install flake8 black build
45+ python -m pip install flake8 black build diff-cover
4646 python -m pip install -e .[dev]
4747 displayName: 'Install dependencies'
4848
@@ -66,9 +66,14 @@ extends:
6666 displayName: 'Install wheel'
6767
6868 - script : |
69- pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing
69+ pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing --cov-fail-under=90
7070 displayName: 'Test with pytest'
71-
71+
72+ - script : |
73+ git fetch origin main
74+ diff-cover coverage.xml --compare-branch=origin/main --fail-under=90
75+ displayName: 'Diff coverage (90% for new changes)'
76+
7277 - task : PublishTestResults@2
7378 condition : succeededOrFailed()
7479 inputs :
Original file line number Diff line number Diff line change 2727 - name : Install dependencies
2828 run : |
2929 python -m pip install --upgrade pip
30- python -m pip install flake8 black build
30+ python -m pip install flake8 black build diff-cover
3131 python -m pip install -e .[dev]
3232
3333 - name : Check format with black
5151
5252 - name : Test with pytest
5353 run : |
54- pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing
54+ pytest --junitxml=test-results.xml --cov=PowerPlatform --cov-report=xml --cov-report=term-missing --cov-fail-under=90
55+
56+ - name : Diff coverage (90% for new changes)
57+ run : |
58+ git fetch origin ${{ github.base_ref }}
59+ diff-cover coverage.xml --compare-branch=origin/${{ github.base_ref }} --fail-under=90
5560
5661 - name : Upload test results
5762 if : always()
You can’t perform that action at this time.
0 commit comments