blob: 3ed3abd02a7146add4489b7fd325999d5f753f8a [file] [log] [blame]
Steve Dower57675092018-09-24 07:44:50 -04001parameters:
2 coverage: false
Steve Dower28f6cb32019-01-22 10:49:52 -08003 sudo_dependencies: sudo
4 dependencies: apt
5 patchcheck: true
6 xvfb: true
Steve Dower57675092018-09-24 07:44:50 -04007
8steps:
9- checkout: self
10 clean: true
11 fetchDepth: 5
12
Steve Dowerb4bcefe2019-04-01 09:10:20 -070013# Work around a known issue affecting Ubuntu VMs on Pipelines
14- script: sudo setfacl -Rb /home/vsts
15 displayName: 'Workaround ACL issue'
16
Steve Dower28f6cb32019-01-22 10:49:52 -080017- script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
Steve Dower57675092018-09-24 07:44:50 -040018 displayName: 'Install dependencies'
19
20- script: ./configure --with-pydebug
21 displayName: 'Configure CPython (debug)'
22
23- script: make -s -j4
24 displayName: 'Build CPython'
25
26- ${{ if eq(parameters.coverage, 'true') }}:
27 - script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
28 displayName: 'Set up virtual environment'
29
30 - script: ./venv/bin/python -m test.pythoninfo
31 displayName: 'Display build info'
32
33 - script: |
Steve Dower28f6cb32019-01-22 10:49:52 -080034 $COMMAND -m coverage run --pylib -m test \
Steve Dower57675092018-09-24 07:44:50 -040035 --fail-env-changed \
36 -uall,-cpu \
Pierre Glaser202d1bd2019-01-08 03:02:26 +010037 --junit-xml=$(build.binariesDirectory)/test-results.xml \
Steve Dower57675092018-09-24 07:44:50 -040038 -x test_multiprocessing_fork \
39 -x test_multiprocessing_forkserver \
40 -x test_multiprocessing_spawn \
41 -x test_concurrent_futures
42 displayName: 'Tests with coverage'
Steve Dower28f6cb32019-01-22 10:49:52 -080043 env:
44 ${{ if eq(parameters.xvfb, 'true') }}:
45 COMMAND: xvfb-run ./venv/bin/python
46 ${{ if ne(parameters.xvfb, 'true') }}:
47 COMMAND: ./venv/bin/python
Steve Dower57675092018-09-24 07:44:50 -040048
49 - script: ./venv/bin/python -m coverage xml
50 displayName: 'Generate coverage.xml'
51
52 - script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash)
53 displayName: 'Publish code coverage results'
54
55
56- ${{ if ne(parameters.coverage, 'true') }}:
57 - script: make pythoninfo
58 displayName: 'Display build info'
59
Steve Dower28f6cb32019-01-22 10:49:52 -080060 - script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
Steve Dower57675092018-09-24 07:44:50 -040061 displayName: 'Tests'
Steve Dower28f6cb32019-01-22 10:49:52 -080062 env:
63 ${{ if eq(parameters.xvfb, 'true') }}:
64 COMMAND: xvfb-run make
65 ${{ if ne(parameters.xvfb, 'true') }}:
66 COMMAND: make
Steve Dower57675092018-09-24 07:44:50 -040067
Steve Dower28f6cb32019-01-22 10:49:52 -080068- ${{ if eq(parameters.patchcheck, 'true') }}:
69 - script: ./python Tools/scripts/patchcheck.py --travis true
70 displayName: 'Run patchcheck.py'
71 condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
Steve Dower57675092018-09-24 07:44:50 -040072
73
74- task: PublishTestResults@2
75 displayName: 'Publish Test Results'
76 inputs:
77 testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
78 mergeTestResults: true
79 testRunTitle: $(testRunTitle)
80 platform: $(testRunPlatform)
81 condition: succeededOrFailed()