This is an automated email from the ASF dual-hosted git repository. potiuk 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 38fa6f4097a Run all tests when standard providers change (#50394) 38fa6f4097a is described below commit 38fa6f4097a2dc13697ca18166192387a2aaf030 Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Fri May 9 16:31:22 2025 +0200 Run all tests when standard providers change (#50394) Similarly to git provider - some of the core tests still depend on the standard providers, and likely some other provider tests are using them too. This PR changes selective checks to always run all tests when standard providers sources change. --- .../src/airflow_breeze/utils/selective_checks.py | 14 +++ dev/breeze/tests/test_selective_checks.py | 103 ++------------------- 2 files changed, 23 insertions(+), 94 deletions(-) diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py b/dev/breeze/src/airflow_breeze/utils/selective_checks.py index 247ab6fa1aa..17a4fecd45e 100644 --- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py +++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py @@ -100,6 +100,7 @@ class FileGroupForCi(Enum): ALWAYS_TESTS_FILES = "always_test_files" API_FILES = "api_files" GIT_PROVIDER_FILES = "git_provider_files" + STANDARD_PROVIDER_FILES = "standard_provider_files" API_CODEGEN_FILES = "api_codegen_files" HELM_FILES = "helm_files" DEPENDENCY_FILES = "dependency_files" @@ -170,6 +171,9 @@ CI_FILE_GROUP_MATCHES = HashableDict( FileGroupForCi.GIT_PROVIDER_FILES: [ r"^providers/git/src/", ], + FileGroupForCi.STANDARD_PROVIDER_FILES: [ + r"^providers/standard/src/", + ], FileGroupForCi.API_CODEGEN_FILES: [ r"^airflow-core/src/airflow/api_fastapi/core_api/openapi/.*generated\.yaml", r"^clients/gen", @@ -543,6 +547,16 @@ class SelectiveChecks: "and for now we have core tests depending on them.[/]" ) return True + if self._matching_files( + FileGroupForCi.STANDARD_PROVIDER_FILES, + CI_FILE_GROUP_MATCHES, + ): + # TODO(potiuk): remove me when we get rid of the dependency + get_console().print( + "[warning]Running full set of tests because standard provider files changed " + "and for now we have core tests depending on them.[/]" + ) + return True if self._matching_files( FileGroupForCi.TESTS_UTILS_FILES, CI_FILE_GROUP_MATCHES, diff --git a/dev/breeze/tests/test_selective_checks.py b/dev/breeze/tests/test_selective_checks.py index 82b9725c71f..5017948bf65 100644 --- a/dev/breeze/tests/test_selective_checks.py +++ b/dev/breeze/tests/test_selective_checks.py @@ -341,48 +341,6 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str): id="All tests should run when API test files change", ) ), - ( - pytest.param( - ("providers/standard/src/airflow/providers/standard/operators/python.py",), - { - "selected-providers-list-as-string": None, - "all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", - "all-python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, - "python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", - "python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, - "ci-image-build": "true", - "prod-image-build": "false", - "needs-helm-tests": "false", - "run-tests": "true", - "run-amazon-tests": "false", - "docs-build": "true", - "skip-pre-commits": ALL_SKIPPED_COMMITS_IF_NO_UI_AND_HELM_TESTS, - "upgrade-to-newer-dependencies": "false", - "core-test-types-list-as-strings-in-json": json.dumps( - [{"description": "Always", "test_types": "Always"}] - ), - "providers-test-types-list-as-strings-in-json": json.dumps( - [ - { - "description": "common.compat...standard", - "test_types": "Providers[common.compat] Providers[standard]", - } - ] - ), - "individual-providers-test-types-list-as-strings-in-json": json.dumps( - [ - { - "description": "common.compat...standard", - "test_types": "Providers[common.compat] Providers[standard]", - } - ] - ), - "needs-mypy": "true", - "mypy-checks": "['mypy-providers']", - }, - id="Only Python tests", - ) - ), ( pytest.param( ("airflow-core/src/airflow/serialization/python.py",), @@ -1038,68 +996,25 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str): pytest.param( ("providers/standard/src/airflow/providers/standard/operators/bash.py",), { - "selected-providers-list-as-string": "common.compat standard", - "all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", - "all-python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, - "python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", - "python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, - "ci-image-build": "true", - "prod-image-build": "false", - "needs-helm-tests": "false", - "run-tests": "true", - "run-amazon-tests": "false", - "docs-build": "true", - "run-kubernetes-tests": "false", - "skip-pre-commits": ALL_SKIPPED_COMMITS_IF_NO_UI_AND_HELM_TESTS, - "upgrade-to-newer-dependencies": "false", - "core-test-types-list-as-strings-in-json": json.dumps( - [{"description": "Always...Serialization", "test_types": "Always Core Serialization"}] - ), - "providers-test-types-list-as-strings-in-json": json.dumps( - [ - { - "description": "common.compat...standard", - "test_types": "Providers[common.compat] Providers[standard]", - } - ] - ), - "needs-mypy": "true", - "mypy-checks": "['mypy-providers']", - }, - id="Providers standard tests and Serialization tests to run when airflow bash.py changed", - ), - pytest.param( - ("providers/standard/src/airflow/providers/standard/operators/bash.py",), - { - "selected-providers-list-as-string": None, "all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", "all-python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, "python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']", "python-versions-list-as-string": DEFAULT_PYTHON_MAJOR_MINOR_VERSION, "ci-image-build": "true", - "prod-image-build": "false", - "needs-helm-tests": "false", + "prod-image-build": "true", + "needs-helm-tests": "true", "run-tests": "true", - "run-amazon-tests": "false", + "run-amazon-tests": "true", "docs-build": "true", - "run-kubernetes-tests": "false", - "skip-pre-commits": ALL_SKIPPED_COMMITS_IF_NO_UI_AND_HELM_TESTS, + "run-kubernetes-tests": "true", + "skip-pre-commits": ALL_SKIPPED_COMMITS_BY_DEFAULT_ON_ALL_TESTS_NEEDED, "upgrade-to-newer-dependencies": "false", - "core-test-types-list-as-strings-in-json": json.dumps( - [{"description": "Always...Serialization", "test_types": "Always Core Serialization"}] - ), - "providers-test-types-list-as-strings-in-json": json.dumps( - [ - { - "description": "common.compat...standard", - "test_types": "Providers[common.compat] Providers[standard]", - } - ] - ), + "core-test-types-list-as-strings-in-json": ALL_CI_SELECTIVE_TEST_TYPES_AS_JSON, + "providers-test-types-list-as-strings-in-json": ALL_PROVIDERS_SELECTIVE_TEST_TYPES_AS_JSON, "needs-mypy": "true", - "mypy-checks": "['mypy-providers']", + "mypy-checks": ALL_MYPY_CHECKS, }, - id="Force Core and Serialization tests to run when tests bash changed", + id="All tests to run when standard operator changed", ), ( pytest.param(