Skip to content

Commit

Permalink
Fix coverage PEP 669 setting for tests (#38213)
Browse files Browse the repository at this point in the history
The coverage fix in #38194 was wrongly applied to Helm tests, not to
the unit tests 🤦. This PR sets it in the right place.
  • Loading branch information
potiuk committed Mar 16, 2024
1 parent 4af69f9 commit 6c99fcc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 0 additions & 2 deletions dev/breeze/src/airflow_breeze/commands/testing_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,6 @@ def helm_tests(
python_version=shell_params.python,
helm_test_package=helm_test_package,
)
if sys.version_info >= (3, 12):
env["COVERAGE_CORE"] = "sysmon"
cmd = ["docker", "compose", "run", "--service-ports", "--rm", "airflow", *pytest_args, *extra_pytest_args]
result = run_command(cmd, check=False, env=env, output_outside_the_group=True)
fix_ownership_using_docker()
Expand Down
13 changes: 13 additions & 0 deletions scripts/in_container/run_ci_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ echo "Starting the tests with those pytest arguments:" "${@}"
echo
set +e

# We have to tweak coverage for Python 3.12 because of the issue with coverage that takes too long, despite
# Using experimental support for Python 3.12 PEP 669. The coverage.py is not yet fully compatible with the
# full scope of PEP-669. That will be fully done when https://github.com/nedbat/coveragepy/issues/1746 is
# resolve for now we are disabling coverage for Python 3.12, but possibly it is enough for now.
PYTHON_3_12_OR_ABOVE=$(python -c "import sys; print(sys.version_info >= (3,12))")

if [[ ${PYTHON_3_12_OR_ABOVE} == "True" ]]; then
echo
echo "${COLOR_BLUE}Enabling experimental PEP-669 support in coverage.py for Python 3.12 and above.${COLOR_RESET}"
echo
export COVERAGE_CORE=sysmon
fi

pytest "${@}"
RES=$?

Expand Down

0 comments on commit 6c99fcc

Please sign in to comment.