From cdc6976cbd233aeadf9a124cd9ecd372bb0fe564 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Wed, 14 Aug 2024 16:02:30 +0200 Subject: [PATCH] Prevent provider lowest-dependency tests to run in non-main branch (#41478) When running tests in v2-10-test branch, lowest depenency tests are run for providers - because when calculating separate tests, the "skip_provider_tests" has not been used to filter them out. This PR fixes it. (cherry picked from commit 75da5074969ec874040ea094d5afe00b7f02be76) --- dev/breeze/src/airflow_breeze/utils/selective_checks.py | 4 ++++ dev/breeze/tests/test_selective_checks.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py b/dev/breeze/src/airflow_breeze/utils/selective_checks.py index 62f5a20abc4e0..224e76c251921 100644 --- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py +++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py @@ -861,6 +861,10 @@ def separate_test_types_list_as_string(self) -> str | None: if "Providers" in current_test_types: current_test_types.remove("Providers") current_test_types.update({f"Providers[{provider}]" for provider in get_available_packages()}) + if self.skip_provider_tests: + current_test_types = { + test_type for test_type in current_test_types if not test_type.startswith("Providers") + } return " ".join(sorted(current_test_types)) @cached_property diff --git a/dev/breeze/tests/test_selective_checks.py b/dev/breeze/tests/test_selective_checks.py index 7c0ca940949cd..6bee6bbc7e308 100644 --- a/dev/breeze/tests/test_selective_checks.py +++ b/dev/breeze/tests/test_selective_checks.py @@ -1075,7 +1075,7 @@ def test_full_test_needed_when_scripts_changes(files: tuple[str, ...], expected_ ), ( pytest.param( - ("INTHEWILD.md",), + ("INTHEWILD.md", "tests/providers/asana.py"), ("full tests needed",), "v2-7-stable", { @@ -1097,6 +1097,9 @@ def test_full_test_needed_when_scripts_changes(files: tuple[str, ...], expected_ "parallel-test-types-list-as-string": "API Always BranchExternalPython " "BranchPythonVenv CLI Core ExternalPython Operators Other PlainAsserts " "PythonVenv Serialization WWW", + "separate-test-types-list-as-string": "API Always BranchExternalPython " + "BranchPythonVenv CLI Core ExternalPython Operators Other PlainAsserts " + "PythonVenv Serialization WWW", "needs-mypy": "true", "mypy-folders": "['airflow', 'docs', 'dev']", },