From a01b8f1ba3e2cd52c73eab7621a665b4f13a0487 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 26 Jun 2025 22:33:47 +0200 Subject: [PATCH] Skip test that needs the .git folder when it is missing When you run breeze tests in breeze - by default .git folder is missing because it is not mounted to inside breeze. This can be remediated with `breeze shell --mount all` but this test should simply not run if .git folder is missing. --- dev/breeze/tests/test_selective_checks.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev/breeze/tests/test_selective_checks.py b/dev/breeze/tests/test_selective_checks.py index 9b67138a9a707..cc3b5e4abc0df 100644 --- a/dev/breeze/tests/test_selective_checks.py +++ b/dev/breeze/tests/test_selective_checks.py @@ -36,6 +36,7 @@ ) from airflow_breeze.utils.functools_cache import clearable_cache from airflow_breeze.utils.packages import get_available_distributions +from airflow_breeze.utils.path_utils import AIRFLOW_ROOT_PATH from airflow_breeze.utils.selective_checks import ( ALL_CI_SELECTIVE_TEST_TYPES, SelectiveChecks, @@ -1274,6 +1275,10 @@ def test_expected_output_pull_request_main( assert_outputs_are_printed(expected_outputs, str(stderr)) +@pytest.mark.skipif( + not (AIRFLOW_ROOT_PATH / ".git").exists(), + reason="This test should not run if .git folder is missing (for example by default in breeze container)", +) @pytest.mark.parametrize( "files, commit_ref, expected_outputs", [