This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new e01877a162 Remove warnings when uploading code coverage (#40139)
e01877a162 is described below
commit e01877a1623948b7953b92d9dfd1df9e9e31df50
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Jun 8 16:49:05 2024 +0200
Remove warnings when uploading code coverage (#40139)
We are not running coverage for Python 3.12 due to slow coverage
for some libraries. Therefore uploading coverage generates
warning when attempting to run post-test-success for Python 3.12.
This change avoids attempting to upload coverage for Python 3.12
and adds extra env variable passed to docker with ENABLE_COVERAGE
status (not necessary but makes it easier to see variables when
running tests).
---
.github/actions/post_tests_success/action.yml | 12 ++++++++----
.github/workflows/integration-tests.yml | 1 +
.github/workflows/run-unit-tests.yml | 1 +
dev/breeze/src/airflow_breeze/params/shell_params.py | 1 +
4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/.github/actions/post_tests_success/action.yml
b/.github/actions/post_tests_success/action.yml
index e8cdfa4602..37b51154d3 100644
--- a/.github/actions/post_tests_success/action.yml
+++ b/.github/actions/post_tests_success/action.yml
@@ -23,6 +23,10 @@ inputs:
description: 'Codecov token'
required: true
default: ''
+ python-version:
+ description: 'Python version'
+ required: true
+ default: ''
runs:
using: "composite"
steps:
@@ -37,14 +41,14 @@ runs:
if: env.ENABLE_COVERAGE == 'true' && env.TEST_TYPES != 'Helm'
shell: bash
run: |
- mkdir ./files/coverage-reposts
- mv ./files/coverage*.xml ./files/coverage-reposts/ || true
+ mkdir ./files/coverage-reports
+ mv ./files/coverage*.xml ./files/coverage-reports/ || true
- name: "Upload all coverage reports to codecov"
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ inputs.codecov-token }}
- if: env.ENABLE_COVERAGE == 'true' && env.TEST_TYPES != 'Helm'
+ if: env.ENABLE_COVERAGE == 'true' && env.TEST_TYPES != 'Helm' &&
inputs.python-version != '3.12'
with:
name: coverage-${{env.JOB_ID}}
flags:
python-${{env.PYTHON_MAJOR_MINOR_VERSION}},${{env.BACKEND}}-${{env.BACKEND_VERSION}}
- directory: "./files/coverage-reposts/"
+ directory: "./files/coverage-reports/"
diff --git a/.github/workflows/integration-tests.yml
b/.github/workflows/integration-tests.yml
index e10447a01a..e831350f5b 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -96,6 +96,7 @@ jobs:
uses: ./.github/actions/post_tests_success
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
+ python-version: ${{ inputs.default-python-version }}
- name: "Post Tests failure: Integration Tests ${{ matrix.integration }}"
uses: ./.github/actions/post_tests_failure
if: failure()
diff --git a/.github/workflows/run-unit-tests.yml
b/.github/workflows/run-unit-tests.yml
index ae108e7981..7828e50ed7 100644
--- a/.github/workflows/run-unit-tests.yml
+++ b/.github/workflows/run-unit-tests.yml
@@ -197,6 +197,7 @@ jobs:
uses: ./.github/actions/post_tests_success
with:
codecov-token: ${{ secrets.CODECOV_TOKEN }}
+ python-version: ${{ matrix.python-version }}
if: success()
- name: "Post Tests failure"
uses: ./.github/actions/post_tests_failure
diff --git a/dev/breeze/src/airflow_breeze/params/shell_params.py
b/dev/breeze/src/airflow_breeze/params/shell_params.py
index 99679ce5ad..f67aa99131 100644
--- a/dev/breeze/src/airflow_breeze/params/shell_params.py
+++ b/dev/breeze/src/airflow_breeze/params/shell_params.py
@@ -509,6 +509,7 @@ class ShellParams:
_set_var(_env, "DOWNGRADE_SQLALCHEMY", self.downgrade_sqlalchemy)
_set_var(_env, "DOWNGRADE_PENDULUM", self.downgrade_pendulum)
_set_var(_env, "ENABLED_SYSTEMS", None, "")
+ _set_var(_env, "ENABLE_COVERAGE", self.enable_coverage)
_set_var(_env, "FLOWER_HOST_PORT", None, FLOWER_HOST_PORT)
_set_var(_env, "FORCE_LOWEST_DEPENDENCIES",
self.force_lowest_dependencies)
_set_var(_env, "SQLALCHEMY_WARN_20", self.force_sa_warnings)