From 0ef7910aab16c829bef7b9b3b665fff11ac7ea70 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Wed, 30 Oct 2024 15:16:43 +0530 Subject: [PATCH 1/2] Run only ui tests for PR with new UI only changes. --- airflow/ui/src/pages/DagsList/Dag/Header.tsx | 2 ++ .../airflow_breeze/utils/selective_checks.py | 5 ++++ dev/breeze/tests/test_selective_checks.py | 27 +++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/airflow/ui/src/pages/DagsList/Dag/Header.tsx b/airflow/ui/src/pages/DagsList/Dag/Header.tsx index 25d674e144130..a0498164cf731 100644 --- a/airflow/ui/src/pages/DagsList/Dag/Header.tsx +++ b/airflow/ui/src/pages/DagsList/Dag/Header.tsx @@ -118,3 +118,5 @@ export const Header = ({ ); }; + +// test diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py b/dev/breeze/src/airflow_breeze/utils/selective_checks.py index fd0f6b19160fb..0696c765b6d7b 100644 --- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py +++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py @@ -801,12 +801,17 @@ def _get_test_types_to_run(self, split_to_individual_providers: bool = False) -> test_always_files = self._matching_files( FileGroupForCi.ALWAYS_TESTS_FILES, CI_FILE_GROUP_MATCHES, CI_FILE_GROUP_EXCLUDES ) + test_ui_files = self._matching_files( + FileGroupForCi.UI_FILES, CI_FILE_GROUP_MATCHES, CI_FILE_GROUP_EXCLUDES + ) + remaining_files = ( set(all_source_files) - set(matched_files) - set(kubernetes_files) - set(system_test_files) - set(test_always_files) + - set(test_ui_files) ) get_console().print(f"[warning]Remaining non test/always files: {len(remaining_files)}[/]") count_remaining_files = len(remaining_files) diff --git a/dev/breeze/tests/test_selective_checks.py b/dev/breeze/tests/test_selective_checks.py index 627779ad0ec82..63b23b3f5a98c 100644 --- a/dev/breeze/tests/test_selective_checks.py +++ b/dev/breeze/tests/test_selective_checks.py @@ -848,6 +848,33 @@ def assert_outputs_are_printed(expected_outputs: dict[str, str], stderr: str): id="All tests should be run when tests_common/ change", ) ), + ( + pytest.param( + ("airflow/ui/src/index.tsx",), + { + "affected-providers-list-as-string": None, + "all-python-versions": "['3.9']", + "all-python-versions-list-as-string": "3.9", + "python-versions": "['3.9']", + "python-versions-list-as-string": "3.9", + "ci-image-build": "true", + "prod-image-build": "false", + "needs-helm-tests": "false", + "run-tests": "true", + "run-amazon-tests": "false", + "docs-build": "false", + "full-tests-needed": "false", + "skip-pre-commits": "check-provider-yaml-valid,flynt,identity,lint-helm-chart,mypy-airflow,mypy-dev,mypy-docs,mypy-providers,mypy-task-sdk,ts-compile-format-lint-www", + "upgrade-to-newer-dependencies": "false", + "parallel-test-types-list-as-string": "Always", + "providers-test-types-list-as-string": "", + "needs-mypy": "false", + "mypy-checks": "[]", + "run-ui-tests": "true", + }, + id="Run only ui tests for PR with new UI only changes.", + ) + ), ], ) def test_expected_output_pull_request_main( From 902467d84c13c7d3ff6ee60a731dae9f3625640b Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Wed, 30 Oct 2024 15:49:42 +0530 Subject: [PATCH 2/2] Revert test change to UI folder. --- airflow/ui/src/pages/DagsList/Dag/Header.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/airflow/ui/src/pages/DagsList/Dag/Header.tsx b/airflow/ui/src/pages/DagsList/Dag/Header.tsx index a0498164cf731..25d674e144130 100644 --- a/airflow/ui/src/pages/DagsList/Dag/Header.tsx +++ b/airflow/ui/src/pages/DagsList/Dag/Header.tsx @@ -118,5 +118,3 @@ export const Header = ({ ); }; - -// test