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 ae351114b8 Fix case where selective checks skip Helm tests on
helm-test-only change (#32941)
ae351114b8 is described below
commit ae351114b8fb0f299eaaa8599b41bcbafd4f655f
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Jul 30 00:17:29 2023 +0200
Fix case where selective checks skip Helm tests on helm-test-only change
(#32941)
When there are only helm tests changes in the incoming PR, the selective
checks would miss CI image building, because none of those would trigger
CI image build. Image build is triggered when one of the other test
types was selected for running. However the Helm unit tests also use
Breeze CI image as a stable runtime environment, so they actually need
CI image to be built.
This change also triggers the CI image build when helm tests are
scheduled to be run.
---
.../src/airflow_breeze/utils/selective_checks.py | 2 +-
dev/breeze/tests/test_selective_checks.py | 24 ++++++++++++++++++++++
2 files changed, 25 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 43c0b8b94b..84e92905ed 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -554,7 +554,7 @@ class SelectiveChecks:
@cached_property
def image_build(self) -> bool:
- return self.run_tests or self.docs_build or self.run_kubernetes_tests
+ return self.run_tests or self.docs_build or self.run_kubernetes_tests
or self.needs_helm_tests
def _select_test_type_if_matching(
self, test_types: set[str], test_type: SelectiveUnitTestTypes
diff --git a/dev/breeze/tests/test_selective_checks.py
b/dev/breeze/tests/test_selective_checks.py
index 60ad9015c2..e3f9bacb98 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -1109,6 +1109,30 @@ def test_docs_filter(files: tuple[str, ...],
expected_outputs: dict[str, str]):
assert_outputs_are_printed(expected_outputs, str(stderr))
[email protected](
+ "files, expected_outputs,",
+ [
+ pytest.param(
+ ("helm_tests/random_helm_test.py",),
+ {
+ "image-build": "true",
+ "needs-helm-tests": "true",
+ },
+ id="Only helm test files changed",
+ )
+ ],
+)
+def test_helm_tests_trigger_ci_build(files: tuple[str, ...], expected_outputs:
dict[str, str]):
+ stderr = SelectiveChecks(
+ files=files,
+ commit_ref="HEAD",
+ github_event=GithubEvents.PULL_REQUEST,
+ pr_labels=(),
+ default_branch="main",
+ )
+ assert_outputs_are_printed(expected_outputs, str(stderr))
+
+
@pytest.mark.parametrize(
"files, labels, expected_outputs, should_fail",
[