File size: 1,260 Bytes
fc0f7bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
parameters:
  name: 'CodeCoverage'
  vmImage: 'ubuntu-latest'
  pyVersion: 3.6

jobs:
- job: ${{ parameters.name }}
  pool:
    vmImage: ${{ parameters.vmImage }}

  steps:
  - task: UsePythonVersion@0
    displayName: 'Use Python ${{ parameters.pyVersion }}'
    inputs:
      versionSpec: ${{ parameters.pyVersion }} 
      addToPath: true

  - template: python-infra-upgrade-steps-template.yml

  - script: pip install -r requirements.txt
    displayName: 'Install required packages'

  - script: python -m pytest test -m "not notebooks" --ignore=test/perf --ignore=test/install --junitxml=./TEST-TEST.xml --cov=fairlearn --cov-report=xml --cov-report=html -o unit_suite_name="${{ parameters.name }}"
    displayName: 'Run tests'

  # Publish code coverage results
  - task: PublishCodeCoverageResults@1
    inputs:
      codeCoverageTool: 'cobertura'
      summaryFileLocation: $(System.DefaultWorkingDirectory)/coverage.xml
      pathToSources: $(System.DefaultWorkingDirectory)
      additionalCodeCoverageFiles: $(System.DefaultWorkingDirectory)/htmlcov/**
      failIfCoverageEmpty: false
      displayName: "Publish Code Coverage"

  - task: PublishTestResults@2
    displayName: 'Publish Test Results **/TEST-*.xml'
    condition: succeededOrFailed()