-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines.yml
33 lines (26 loc) · 1.08 KB
/
azure-pipelines.yml
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
28
29
30
31
32
33
# Python test sample
# Sample that demonstrates how to leverage the parallel jobs capability of Azure Pipelines to run python tests in parallel.
# Parallelizing tests helps in reducing the time spent in testing and can speed up the pipelines significantly.
jobs:
- job: 'ParallelTesting'
pool: 'Hosted VS2017'
strategy:
parallel: 3
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.x'
- script: 'python -m pip install --upgrade pip && pip install -r $(System.DefaultWorkingDirectory)/requirements.txt'
displayName: 'Install dependencies'
- powershell: ./DistributeTests.ps1
displayName: 'PowerShell Script to distribute tests'
- script: |
echo $(pytestfiles)
pip install pytest && pytest $(pytestfiles) --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest'
continueOnError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **/test-results.xml'
inputs:
testResultsFiles: '**/test-results.xml'
testRunTitle: 'Python $(python.version)'
condition: succeededOrFailed()