2018-09-24 11:44:50 +00:00
|
|
|
parameters:
|
|
|
|
coverage: false
|
2019-01-22 18:49:52 +00:00
|
|
|
sudo_dependencies: sudo
|
|
|
|
dependencies: apt
|
|
|
|
patchcheck: true
|
|
|
|
xvfb: true
|
2018-09-24 11:44:50 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
clean: true
|
|
|
|
fetchDepth: 5
|
|
|
|
|
2019-04-01 16:10:20 +00:00
|
|
|
# Work around a known issue affecting Ubuntu VMs on Pipelines
|
|
|
|
- script: sudo setfacl -Rb /home/vsts
|
|
|
|
displayName: 'Workaround ACL issue'
|
|
|
|
|
2019-01-22 18:49:52 +00:00
|
|
|
- script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
|
2018-09-24 11:44:50 +00:00
|
|
|
displayName: 'Install dependencies'
|
|
|
|
|
|
|
|
- script: ./configure --with-pydebug
|
|
|
|
displayName: 'Configure CPython (debug)'
|
|
|
|
|
2020-02-26 19:21:41 +00:00
|
|
|
- script: make -j4
|
2018-09-24 11:44:50 +00:00
|
|
|
displayName: 'Build CPython'
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.coverage, 'true') }}:
|
|
|
|
- script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
|
|
|
|
displayName: 'Set up virtual environment'
|
|
|
|
|
|
|
|
- script: ./venv/bin/python -m test.pythoninfo
|
|
|
|
displayName: 'Display build info'
|
|
|
|
|
|
|
|
- script: |
|
2019-01-22 18:49:52 +00:00
|
|
|
$COMMAND -m coverage run --pylib -m test \
|
2018-09-24 11:44:50 +00:00
|
|
|
--fail-env-changed \
|
|
|
|
-uall,-cpu \
|
2019-01-08 02:02:26 +00:00
|
|
|
--junit-xml=$(build.binariesDirectory)/test-results.xml \
|
2018-09-24 11:44:50 +00:00
|
|
|
-x test_multiprocessing_fork \
|
|
|
|
-x test_multiprocessing_forkserver \
|
|
|
|
-x test_multiprocessing_spawn \
|
|
|
|
-x test_concurrent_futures
|
|
|
|
displayName: 'Tests with coverage'
|
2019-01-22 18:49:52 +00:00
|
|
|
env:
|
|
|
|
${{ if eq(parameters.xvfb, 'true') }}:
|
|
|
|
COMMAND: xvfb-run ./venv/bin/python
|
|
|
|
${{ if ne(parameters.xvfb, 'true') }}:
|
|
|
|
COMMAND: ./venv/bin/python
|
2018-09-24 11:44:50 +00:00
|
|
|
|
|
|
|
- script: ./venv/bin/python -m coverage xml
|
|
|
|
displayName: 'Generate coverage.xml'
|
|
|
|
|
2020-02-27 23:08:30 +00:00
|
|
|
- script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
|
2018-09-24 11:44:50 +00:00
|
|
|
displayName: 'Publish code coverage results'
|
|
|
|
|
|
|
|
|
|
|
|
- ${{ if ne(parameters.coverage, 'true') }}:
|
|
|
|
- script: make pythoninfo
|
|
|
|
displayName: 'Display build info'
|
|
|
|
|
2019-01-22 18:49:52 +00:00
|
|
|
- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
|
2018-09-24 11:44:50 +00:00
|
|
|
displayName: 'Tests'
|
2019-01-22 18:49:52 +00:00
|
|
|
env:
|
|
|
|
${{ if eq(parameters.xvfb, 'true') }}:
|
|
|
|
COMMAND: xvfb-run make
|
|
|
|
${{ if ne(parameters.xvfb, 'true') }}:
|
|
|
|
COMMAND: make
|
|
|
|
|
|
|
|
- ${{ if eq(parameters.patchcheck, 'true') }}:
|
|
|
|
- script: ./python Tools/scripts/patchcheck.py --travis true
|
|
|
|
displayName: 'Run patchcheck.py'
|
|
|
|
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
|
2018-09-24 11:44:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: 'Publish Test Results'
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
|
|
|
|
mergeTestResults: true
|
|
|
|
testRunTitle: $(testRunTitle)
|
|
|
|
platform: $(testRunPlatform)
|
|
|
|
condition: succeededOrFailed()
|