Home | History | Annotate | Download | only in .azure-pipelines
      1 parameters:
      2   coverage: false
      3   sudo_dependencies: sudo
      4   dependencies: apt
      5   patchcheck: true
      6   xvfb: true
      7 
      8 steps:
      9 - checkout: self
     10   clean: true
     11   fetchDepth: 5
     12 
     13 - script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
     14   displayName: 'Install dependencies'
     15 
     16 - script: ./configure --with-pydebug
     17   displayName: 'Configure CPython (debug)'
     18 
     19 - script: make -s -j4
     20   displayName: 'Build CPython'
     21 
     22 - ${{ if eq(parameters.coverage, 'true') }}:
     23   - script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
     24     displayName: 'Set up virtual environment'
     25 
     26   - script: ./venv/bin/python -m test.pythoninfo
     27     displayName: 'Display build info'
     28 
     29   - script: |
     30       $COMMAND -m coverage run --pylib -m test \
     31                 --fail-env-changed \
     32                 -uall,-cpu \
     33                 --junit-xml=$(build.binariesDirectory)/test-results.xml" \
     34                 -x test_multiprocessing_fork \
     35                 -x test_multiprocessing_forkserver \
     36                 -x test_multiprocessing_spawn \
     37                 -x test_concurrent_futures
     38     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
     44 
     45   - script: ./venv/bin/python -m coverage xml
     46     displayName: 'Generate coverage.xml'
     47 
     48   - script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash)
     49     displayName: 'Publish code coverage results'
     50 
     51 
     52 - ${{ if ne(parameters.coverage, 'true') }}:
     53   - script: make pythoninfo
     54     displayName: 'Display build info'
     55 
     56   - script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
     57     displayName: 'Tests'
     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'))
     68 
     69 
     70 - task: PublishTestResults@2
     71   displayName: 'Publish Test Results'
     72   inputs:
     73     testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
     74     mergeTestResults: true
     75     testRunTitle: $(testRunTitle)
     76     platform: $(testRunPlatform)
     77   condition: succeededOrFailed()
     78