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 cb65c38bb3 Optimize CI jobs when for example only pre-commits change
in scripts (#37308)
cb65c38bb3 is described below
commit cb65c38bb3b4057aba0fb883fd180b32bcb61091
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)
---
.../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 ad38f450c2..8886a5cb94 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -113,7 +113,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 e23c2b80c2..9109c4544e 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,",
[