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 189c506e31c Fix task-sdk-integration-tests selective checks (#58683)
189c506e31c is described below
commit 189c506e31cd93446680193e5e0a69512f8d91e2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Nov 25 20:20:23 2025 +0100
Fix task-sdk-integration-tests selective checks (#58683)
When only task-sdk-integration tests are changed, the tests should
run. Currently they don't run because in this case PROD image has
is not build.
This PR fixes the selective checks.
---
.github/workflows/additional-prod-image-tests.yml | 5 ++++
.github/workflows/ci-amd-arm.yml | 2 ++
.../src/airflow_breeze/utils/selective_checks.py | 12 ++++++++-
dev/breeze/tests/test_selective_checks.py | 31 +++++++++++++++++++++-
4 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/additional-prod-image-tests.yml
b/.github/workflows/additional-prod-image-tests.yml
index 6f87989e9ad..69958d1ee2b 100644
--- a/.github/workflows/additional-prod-image-tests.yml
+++ b/.github/workflows/additional-prod-image-tests.yml
@@ -32,6 +32,10 @@ on: # yamllint disable-line rule:truthy
description: "The default branch for the repository"
required: true
type: string
+ run-task-sdk-integration-tests:
+ description: "Whether to run Task SDK integration tests (true/false)"
+ required: true
+ type: string
constraints-branch:
description: "Branch used to construct constraints URL from."
required: true
@@ -191,6 +195,7 @@ jobs:
id: breeze
- name: "Run Task SDK integration tests"
run: breeze testing task-sdk-integration-tests
--skip-mounting-local-volumes
+ if: inputs.run-task-sdk-integration-tests == 'true'
test-e2e-integration-tests-basic:
name: "Test e2e integration tests with PROD image"
diff --git a/.github/workflows/ci-amd-arm.yml b/.github/workflows/ci-amd-arm.yml
index f64e2bbd90e..a8a38149cfb 100644
--- a/.github/workflows/ci-amd-arm.yml
+++ b/.github/workflows/ci-amd-arm.yml
@@ -116,6 +116,7 @@ jobs:
run-mypy: ${{ steps.selective-checks.outputs.run-mypy }}
run-system-tests: ${{ steps.selective-checks.outputs.run-system-tests }}
run-task-sdk-tests: ${{
steps.selective-checks.outputs.run-task-sdk-tests }}
+ run-task-sdk-integration-tests: ${{
steps.selective-checks.outputs.run-task-sdk-integration-tests }}
runner-type: ${{ steps.selective-checks.outputs.runner-type }}
run-ui-tests: ${{ steps.selective-checks.outputs.run-ui-tests }}
run-unit-tests: ${{ steps.selective-checks.outputs.run-unit-tests }}
@@ -771,6 +772,7 @@ jobs:
docker-cache: ${{ needs.build-info.outputs.docker-cache }}
disable-airflow-repo-cache: ${{
needs.build-info.outputs.disable-airflow-repo-cache }}
default-python-version: "${{
needs.build-info.outputs.default-python-version }}"
+ run-task-sdk-integration-tests: ${{
needs.build-info.outputs.run-task-sdk-integration-tests }}
canary-run: ${{ needs.build-info.outputs.canary-run }}
use-uv: ${{ needs.build-info.outputs.use-uv }}
if: needs.build-info.outputs.prod-image-build == 'true'
diff --git a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
index 1464ea8ca6b..5efa6953992 100644
--- a/dev/breeze/src/airflow_breeze/utils/selective_checks.py
+++ b/dev/breeze/src/airflow_breeze/utils/selective_checks.py
@@ -114,6 +114,7 @@ class FileGroupForCi(Enum):
SYSTEM_TEST_FILES = auto()
KUBERNETES_FILES = auto()
TASK_SDK_FILES = auto()
+ TASK_SDK_INTEGRATION_TEST_FILES = auto()
GO_SDK_FILES = auto()
AIRFLOW_CTL_FILES = auto()
ALL_PYPROJECT_TOML_FILES = auto()
@@ -282,6 +283,9 @@ CI_FILE_GROUP_MATCHES: HashableDict[FileGroupForCi] =
HashableDict(
r"^task-sdk/src/airflow/sdk/.*\.py$",
r"^task-sdk/tests/.*\.py$",
],
+ FileGroupForCi.TASK_SDK_INTEGRATION_TEST_FILES: [
+ r"^task-sdk-integration-tests/.*\.py$",
+ ],
FileGroupForCi.GO_SDK_FILES: [
r"^go-sdk/.*\.go$",
],
@@ -876,6 +880,12 @@ class SelectiveChecks:
def run_task_sdk_tests(self) -> bool:
return self._should_be_run(FileGroupForCi.TASK_SDK_FILES)
+ @cached_property
+ def run_task_sdk_integration_tests(self) -> bool:
+ return self._should_be_run(FileGroupForCi.TASK_SDK_FILES) or
self._should_be_run(
+ FileGroupForCi.TASK_SDK_INTEGRATION_TEST_FILES
+ )
+
@cached_property
def run_go_sdk_tests(self) -> bool:
return self._should_be_run(FileGroupForCi.GO_SDK_FILES)
@@ -943,7 +953,7 @@ class SelectiveChecks:
@cached_property
def prod_image_build(self) -> bool:
- return self.run_kubernetes_tests or self.run_helm_tests
+ return self.run_kubernetes_tests or self.run_helm_tests or
self.run_task_sdk_integration_tests
def _select_test_type_if_matching(
self, test_types: set[str], test_type: SelectiveCoreTestType
diff --git a/dev/breeze/tests/test_selective_checks.py
b/dev/breeze/tests/test_selective_checks.py
index 40256e869a5..6fb161dc000 100644
--- a/dev/breeze/tests/test_selective_checks.py
+++ b/dev/breeze/tests/test_selective_checks.py
@@ -602,12 +602,13 @@ def assert_outputs_are_printed(expected_outputs:
dict[str, str], stderr: str):
"python-versions":
f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
"python-versions-list-as-string":
DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
"ci-image-build": "true",
- "prod-image-build": "false",
+ "prod-image-build": "true",
"run-api-tests": "false",
"run-helm-tests": "false",
"run-kubernetes-tests": "false",
"run-unit-tests": "true",
"run-task-sdk-tests": "true",
+ "run-task-sdk-integration-tests": "true",
"docs-build": "true",
"full-tests-needed": "false",
"skip-prek-hooks":
ALL_SKIPPED_COMMITS_IF_NO_PROVIDERS_UI_AND_HELM_TESTS,
@@ -621,6 +622,34 @@ def assert_outputs_are_printed(expected_outputs: dict[str,
str], stderr: str):
id="Task SDK source file changed - Task SDK, Core and provider
tests should run",
)
),
+ (
+ pytest.param(
+ ("task-sdk-integration-tests/tests/airflow/sdk/random.py",),
+ {
+ "all-python-versions":
f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
+ "all-python-versions-list-as-string":
DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
+ "python-versions":
f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
+ "python-versions-list-as-string":
DEFAULT_PYTHON_MAJOR_MINOR_VERSION,
+ "ci-image-build": "false",
+ "prod-image-build": "true",
+ "run-api-tests": "false",
+ "run-helm-tests": "false",
+ "run-kubernetes-tests": "false",
+ "run-unit-tests": "false",
+ "run-task-sdk-tests": "false",
+ "run-task-sdk-integration-tests": "true",
+ "docs-build": "false",
+ "full-tests-needed": "false",
+ "skip-prek-hooks":
ALL_SKIPPED_COMMITS_IF_NO_PROVIDERS_UI_AND_HELM_TESTS,
+ "skip-providers-tests": "true",
+ "upgrade-to-newer-dependencies": "false",
+ "run-mypy": "false",
+ "mypy-checks": "[]",
+ },
+ id="Task SDK integration tests files changed - "
+ "Task SDK integration tests and prod image build should run
but no other tests",
+ )
+ ),
(
pytest.param(
(