aboutsummaryrefslogtreecommitdiffstats
path: root/azure-pipelines.yml
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-06-22 14:12:44 -0700
committerGravatar MarkKoz <[email protected]>2019-06-22 14:12:44 -0700
commit6cab499ec57b10081b79bff25aa9c0792b7d8fe7 (patch)
tree97cb282f8efc1ce0f28996d1313063ecb5119338 /azure-pipelines.yml
parentFix venv being included in coverage when testing in a container (diff)
Add CI steps for running & publishing tests
Diffstat (limited to 'azure-pipelines.yml')
-rw-r--r--azure-pipelines.yml37
1 files changed, 30 insertions, 7 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index bd916a4..de6827a 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -2,32 +2,55 @@
jobs:
- job: test
- displayName: 'Lint'
+ displayName: 'Lint & Test'
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: UsePythonVersion@0
- displayName: 'Set Python version'
+ displayName: 'Set Python Version'
inputs:
versionSpec: '3.7.x'
addToPath: true
- script: pip3 install pipenv
- displayName: 'Install pipenv'
+ displayName: 'Install Pipenv'
- script: pipenv install --dev --deploy --system
- displayName: 'Install project using pipenv'
+ displayName: 'Install Dependencies with Pipenv'
- script: python3 -m flake8 --format junit-xml --output-file test-lint.xml
- displayName: 'Run linter'
+ displayName: 'Run Linter'
- task: PublishTestResults@2
condition: succeededOrFailed()
+ displayName: 'Publish Lint Results'
inputs:
- testResultsFiles: '**/test-*.xml'
- testRunTitle: 'Snekbox Flake8 Lint Results'
+ testResultsFiles: 'test-lint.xml'
+ testRunTitle: 'Lint Results'
+
+ - script: coverage run -m xmlrunner
+ displayName: 'Run Unit Tests'
+
+ - task: PublishTestResults@2
+ condition: succeededOrFailed()
+ displayName: 'Publish Test Results'
+ inputs:
+ testResultsFiles: '**/TEST-*.xml'
+ testRunTitle: 'Lint Results'
+
+ - script: |
+ coverage xml
+ coverage report
+ displayName: 'Generate Coverage Report'
+
+ - task: PublishCodeCoverageResults@1
+ displayName: 'Publish Coverage Results'
+ inputs:
+ codeCoverageTool: Cobertura
+ summaryFileLocation: '**/coverage.xml'
+ reportDirectory: '**/htmlcov'
- job: build
displayName: 'Build'