From 1b1b27df285fc6c76d2c9639f50d2228a64aa2c5 Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 31 Jan 2023 22:08:43 -0800 Subject: [PATCH] Change coverage upload condition (#9552) * change coverage upload condition * fix typo * set uploadCoverage * add comment * change coverage upload condition * verbose version --- .azure-pipelines/main.yml | 8 ++++++++ .azure-pipelines/templates/jobs/standard-tests-jobs.yml | 5 ----- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index d3c3a152e..c82647bd8 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -6,5 +6,13 @@ pr: - master - '*.x' +variables: + # We set this here to avoid coverage data being uploaded from things like our + # nightly pipeline. This is done because codecov (helpfully) keeps track of + # the number of coverage uploads for a commit and displays a warning when + # comparing two commits with an unequal number of uploads. Only uploading + # coverage here should keep the number of uploads it sees consistent. + uploadCoverage: true + jobs: - template: templates/jobs/standard-tests-jobs.yml diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 5d0044d19..1e6d7a352 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -11,7 +11,6 @@ jobs: macos-cover: IMAGE_NAME: macOS-12 TOXENV: cover - UPLOAD_COVERAGE: 1 windows-py37: IMAGE_NAME: windows-2019 PYTHON_VERSION: 3.7 @@ -20,12 +19,10 @@ jobs: IMAGE_NAME: windows-2019 PYTHON_VERSION: 3.9 TOXENV: cover-win - UPLOAD_COVERAGE: 1 windows-integration-certbot: IMAGE_NAME: windows-2019 PYTHON_VERSION: 3.9 TOXENV: integration-certbot - UPLOAD_COVERAGE: 1 linux-oldest-tests-1: IMAGE_NAME: ubuntu-22.04 PYTHON_VERSION: 3.7 @@ -41,7 +38,6 @@ jobs: linux-cover: IMAGE_NAME: ubuntu-22.04 TOXENV: cover - UPLOAD_COVERAGE: 1 linux-lint: IMAGE_NAME: ubuntu-22.04 TOXENV: lint-posix @@ -53,7 +49,6 @@ jobs: PYTHON_VERSION: 3.8 TOXENV: integration ACME_SERVER: pebble - UPLOAD_COVERAGE: 1 apache-compat: IMAGE_NAME: ubuntu-22.04 TOXENV: apache_compat diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index ae8a2c56b..5557bac68 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -79,5 +79,5 @@ steps: chmod +x codecov coverage xml ./codecov || echo "Uploading coverage data failed" - condition: ne(variables['UPLOAD_COVERAGE'], '') + condition: and(eq(variables['uploadCoverage'], true), or(startsWith(variables['TOXENV'], 'cover'), startsWith(variables['TOXENV'], 'integration'))) displayName: Upload coverage data