Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions dev/breeze/src/airflow_breeze/utils/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def generate_args_for_pytest(
args.extend(get_excluded_provider_args(python_version))
if use_xdist:
args.extend(["-n", str(parallelism) if parallelism else "auto"])
# We have to disabke coverage for Python 3.12 because of the issue with coverage that takes too long, despite
# We have to disable 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, and it causes slower execution and occasional
Expand Down Expand Up @@ -417,5 +417,13 @@ def convert_parallel_types_to_folders(
python_version=python_version,
)
)
# leave only folders, strip --pytest-args
return [arg for arg in args if arg.startswith("test")]
# leave only folders, strip --pytest-args that exclude some folders with `-' prefix
folders = [arg for arg in args if arg.startswith("test")]
# remove specific provider sub-folders if "tests/providers" is already in the list
# This workarounds pytest issues where it will only run tests from specific subfolders
# if both parent and child folders are in the list
# The issue in Pytest (changed behaviour in Pytest 8.2 is tracked here
# https://github.com/pytest-dev/pytest/issues/12605
if "tests/providers" in folders:
folders = [folder for folder in folders if not folder.startswith("tests/providers/")]
return folders
13 changes: 13 additions & 0 deletions dev/breeze/tests/test_pytest_args_for_test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,19 @@ def test_pytest_args_for_helm_test_types(helm_test_package: str, pytest_args: li
],
True,
),
(
"Core Providers[-amazon,google] Providers[amazon] Providers[google]",
[
"tests/core",
"tests/executors",
"tests/jobs",
"tests/models",
"tests/ti_deps",
"tests/utils",
"tests/providers",
],
False,
),
],
)
def test_folders_for_parallel_test_types(
Expand Down