diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index 93d2c7805d8..c727fc41e65 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -21,6 +21,7 @@ variables: value: '2df3ae11-3bf6-49bc-a809-ba0d340d6a6d' - name: PythonMain value: '35' + - group: codecov stages: @@ -110,13 +111,28 @@ stages: displayName: 'Install Home Assistant for python $(python.version)' - script: | . venv/bin/activate - pytest --timeout=9 --durations=10 --junitxml=junit/test-results.xml -qq -o console_output_style=count -p no:sugar tests + pytest --timeout=9 --durations=10 --junitxml=test-results.xml -qq -o console_output_style=count -p no:sugar tests displayName: 'Run pytest for python $(python.version)' + condition: and(succeeded(), ne(variables['python.container'], variables['PythonMain'])) + - script: | + . venv/bin/activate + pytest --timeout=9 --durations=10 --junitxml=test-results.xml --cov --cov-report=xml -qq -o console_output_style=count -p no:sugar tests + codecov + displayName: 'Run pytest for python $(python.version) / coverage' + env: + CODECOV_TOKEN: '$(codecovToken)' + condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain'])) - task: PublishTestResults@2 condition: succeededOrFailed() inputs: - testResultsFiles: '**/test-*.xml' + testResultsFiles: 'test-results.xml' testRunTitle: 'Publish test results for Python $(python.version)' + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: cobertura + summaryFileLocation: coverage.xml + displayName: 'publish coverage artifact' + condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain'])) - stage: 'FullCheck' dependsOn: