Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 1 | parameters: |
| 2 | coverage: false |
Steve Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 3 | sudo_dependencies: sudo |
| 4 | dependencies: apt |
| 5 | patchcheck: true |
| 6 | xvfb: true |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 7 | |
| 8 | steps: |
| 9 | - checkout: self |
| 10 | clean: true |
| 11 | fetchDepth: 5 |
| 12 | |
Steve Dower | b4bcefe | 2019-04-01 09:10:20 -0700 | [diff] [blame] | 13 | # Work around a known issue affecting Ubuntu VMs on Pipelines |
| 14 | - script: sudo setfacl -Rb /home/vsts |
| 15 | displayName: 'Workaround ACL issue' |
| 16 | |
Steve Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 17 | - script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version) |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 18 | 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 Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 34 | $COMMAND -m coverage run --pylib -m test \ |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 35 | --fail-env-changed \ |
| 36 | -uall,-cpu \ |
Pierre Glaser | 202d1bd | 2019-01-08 03:02:26 +0100 | [diff] [blame] | 37 | --junit-xml=$(build.binariesDirectory)/test-results.xml \ |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 38 | -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 Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 43 | 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 Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 48 | |
| 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 Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 60 | - script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml" |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 61 | displayName: 'Tests' |
Steve Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 62 | env: |
| 63 | ${{ if eq(parameters.xvfb, 'true') }}: |
| 64 | COMMAND: xvfb-run make |
| 65 | ${{ if ne(parameters.xvfb, 'true') }}: |
| 66 | COMMAND: make |
Steve Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 67 | |
Steve Dower | 28f6cb3 | 2019-01-22 10:49:52 -0800 | [diff] [blame] | 68 | - ${{ 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 Dower | 5767509 | 2018-09-24 07:44:50 -0400 | [diff] [blame] | 72 | |
| 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() |