forked from microsoft/MLOpsPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-quality-template.yml
More file actions
27 lines (24 loc) · 887 Bytes
/
code-quality-template.yml
File metadata and controls
27 lines (24 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Pipeline template to run linting, unit tests with code coverage, and publish the results.
steps:
- script: |
flake8 --output-file=lint-testresults.xml --format junit-xml
displayName: 'Run lint tests'
- script: |
python -m pytest . --cov=diabetes_regression --cov-report=html --cov-report=xml --junitxml=unit-testresults.xml
condition: succeededOrFailed()
displayName: 'Run unit tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '*-testresults.xml'
testRunTitle: 'Linting & Unit tests'
failTaskOnFailedTests: true
displayName: 'Publish test results'
- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage report'
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: 'coverage.xml'
reportDirectory: 'htmlcov'
failIfCoverageEmpty: true