This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-8-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 55f1c80976c973f093d3b27b1d5cde375e7b6bbb
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sat Feb 10 17:54:05 2024 +0100

    Optimize CI jobs when for example only pre-commits change in scripts 
(#37308)
    
    (cherry picked from commit cb65c38bb3b4057aba0fb883fd180b32bcb61091)
---
 .../src/airflow_breeze/utils/selective_checks.py   |  5 ++-
 dev/breeze/tests/test_selective_checks.py          | 51 ++++++++++++++++++++++
 2 files changed, 55 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 80d2955df6..4f9a383a36 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -117,7 +117,10 @@ CI_FILE_GROUP_MATCHES = HashableDict(
             r"^dev/breeze",
             r"^dev/.*\.py$",
             r"^Dockerfile",
-            r"^scripts",
+            r"^scripts/ci/docker-compose",
+            r"^scripts/ci/kubernetes",
+            r"^scripts/docker",
+            r"^scripts/in_container",
             r"^generated/provider_dependencies.json$",
         ],
         FileGroupForCi.PYTHON_PRODUCTION_FILES: [
diff --git a/dev/breeze/tests/test_selective_checks.py 
b/dev/breeze/tests/test_selective_checks.py
index 1276e625db..d1b47b6a34 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -642,6 +642,57 @@ def test_full_test_needed_when_pyproject_toml_changes(
     assert_outputs_are_printed(expected_outputs, str(stderr))
 
 
[email protected](
+    "files, expected_outputs",
+    [
+        (
+            pytest.param(
+                ("scripts/ci/pre_commit/file.sh",),
+                {
+                    "full-tests-needed": "false",
+                },
+                id="No full tests needed when pre-commit scripts change",
+            )
+        ),
+        (
+            pytest.param(
+                ("scripts/docker-compose/test.yml",),
+                {
+                    "full-tests-needed": "true",
+                },
+                id="Full tests needed when docker-compose changes",
+            )
+        ),
+        (
+            pytest.param(
+                ("scripts/ci/kubernetes/some_file.txt",),
+                {
+                    "full-tests-needed": "true",
+                },
+                id="Full tests needed when ci/kubernetes changes",
+            )
+        ),
+        (
+            pytest.param(
+                ("scripts/in_container/script.sh",),
+                {
+                    "full-tests-needed": "true",
+                },
+                id="Full tests needed when in_container script changes",
+            )
+        ),
+    ],
+)
+def test_full_test_needed_when_scripts_changes(files: tuple[str, ...], 
expected_outputs: dict[str, str]):
+    stderr = SelectiveChecks(
+        files=files,
+        github_event=GithubEvents.PULL_REQUEST,
+        commit_ref="HEAD",
+        default_branch="main",
+    )
+    assert_outputs_are_printed(expected_outputs, str(stderr))
+
+
 @pytest.mark.parametrize(
     "files, pr_labels, default_branch, expected_outputs,",
     [

Reply via email to