Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev/breeze/doc/ci/04_selective_checks.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ This table summarizes the labels you can use on PRs to control the selective che
|----------------------------------|----------------------------------|-------------------------------------------------------------------------------------------|
| all versions | all-versions, *-versions-* | Run tests for all python and k8s versions. |
| allow suspended provider changes | allow-suspended-provider-changes | Allow changes to suspended providers. |
| area:kubernetes-tests | run-kubernetes-tests | If set, the Kubernetes tests job is run regardless of changed files (does not force the full test matrix). |
| canary | is-canary-run | If set, the PR run from apache/airflow repo behaves as `canary` run. |
| debug ci resources | debug-ci-resources | If set, then debugging resources is enabled during parallel tests and you can see them. |
| default versions only | all-versions, *-versions-* | If set, the number of Python and Kubernetes, DB versions are limited to the default ones. |
Expand Down
7 changes: 7 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
USE_PUBLIC_RUNNERS_LABEL = "use public runners"
ALLOW_PROVIDER_DEPENDENCY_BUMP_LABEL = "allow provider dependency bump"
SKIP_COMMON_COMPAT_CHECK_LABEL = "skip common compat check"
AREA_KUBERNETES_TESTS_LABEL = "area:kubernetes-tests"
ALL_CI_SELECTIVE_TEST_TYPES = "API Always CLI Core Other Serialization"

ALL_PROVIDERS_SELECTIVE_TEST_TYPES = (
Expand Down Expand Up @@ -1061,6 +1062,12 @@ def run_scripts_tests(self) -> bool:

@cached_property
def run_kubernetes_tests(self) -> bool:
if AREA_KUBERNETES_TESTS_LABEL in self._pr_labels:
console_print(
"[warning]Running Kubernetes tests because "
f"label '{AREA_KUBERNETES_TESTS_LABEL}' is in {self._pr_labels}[/]"
)
return True
return self._should_be_run(FileGroupForCi.KUBERNETES_FILES)

@cached_property
Expand Down
27 changes: 27 additions & 0 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3518,6 +3518,33 @@ def test_individual_providers_excludes_platform_excluded_on_arm():
assert "Providers[ibm.mq]" in amd_output


def test_run_kubernetes_tests_forced_by_label():
"""`area:kubernetes-tests` forces the Kubernetes tests job without pulling in
the full test matrix, unlike `full tests needed`."""
checks = SelectiveChecks(
files=("INTHEWILD.md",),
commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
default_branch="main",
pr_labels=("area:kubernetes-tests",),
)
assert checks.run_kubernetes_tests is True
assert checks.full_tests_needed is False


def test_run_kubernetes_tests_forced_by_label_with_no_changed_files():
"""The label still forces the Kubernetes tests job even when no files changed."""
checks = SelectiveChecks(
files=(),
commit_ref=NEUTRAL_COMMIT,
github_event=GithubEvents.PULL_REQUEST,
default_branch="main",
pr_labels=("area:kubernetes-tests",),
)
assert checks.run_kubernetes_tests is True
assert checks.full_tests_needed is False


def test_filter_platform_excluded_test_types_handles_all_shapes():
"""Direct unit check of the in-place filter for the three Providers[...] shapes."""
checks = SelectiveChecks(
Expand Down
Loading