11parameters :
22 coverage : false
3+ sudo_dependencies : sudo
4+ dependencies : apt
5+ patchcheck : true
6+ xvfb : true
37
48steps :
59- checkout : self
610 clean : true
711 fetchDepth : 5
812
9- - script : . /.azure-pipelines/posix-deps.sh $(openssl_version)
13+ - script : ${{ parameters.sudo_dependencies }} . /.azure-pipelines/posix-deps-${{ parameters.dependencies }} .sh $(openssl_version)
1014 displayName : ' Install dependencies'
1115
1216- script : ./configure --with-pydebug
2327 displayName : ' Display build info'
2428
2529 - script : |
26- xvfb-run ./venv/bin/python -m coverage run --pylib -m test \
30+ $COMMAND -m coverage run --pylib -m test \
2731 --fail-env-changed \
2832 -uall,-cpu \
2933 --junit-xml=$(build.binariesDirectory)/test-results.xml \
@@ -32,6 +36,11 @@ steps:
3236 -x test_multiprocessing_spawn \
3337 -x test_concurrent_futures
3438 displayName: 'Tests with coverage'
39+ env:
40+ ${{ if eq(parameters.xvfb, 'true') }}:
41+ COMMAND: xvfb-run ./venv/bin/python
42+ ${{ if ne(parameters.xvfb, 'true') }}:
43+ COMMAND: ./venv/bin/python
3544
3645 - script : ./venv/bin/python -m coverage xml
3746 displayName : ' Generate coverage.xml'
@@ -44,13 +53,18 @@ steps:
4453 - script : make pythoninfo
4554 displayName : ' Display build info'
4655
47- - script : xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
56+ - script : $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
4857 displayName : ' Tests'
49-
50-
51- - script : ./python Tools/scripts/patchcheck.py --travis true
52- displayName : ' Run patchcheck.py'
53- condition : and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
58+ env :
59+ ${{ if eq(parameters.xvfb, 'true') }} :
60+ COMMAND : xvfb-run make
61+ ${{ if ne(parameters.xvfb, 'true') }} :
62+ COMMAND : make
63+
64+ - ${{ if eq(parameters.patchcheck, 'true') }} :
65+ - script : ./python Tools/scripts/patchcheck.py --travis true
66+ displayName : ' Run patchcheck.py'
67+ condition : and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
5468
5569
5670- task : PublishTestResults@2
0 commit comments