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
21 changes: 20 additions & 1 deletion dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,26 @@ def generate_provider_dependencies_if_needed():
# END OF EXTRAS LIST UPDATED BY PRE COMMIT
]

PROVIDERS_COMPATIBILITY_TESTS_MATRIX: list[dict[str, str | list[str]]] = []
PROVIDERS_COMPATIBILITY_TESTS_MATRIX: list[dict[str, str | list[str]]] = [
{
"python-version": "3.10",
"airflow-version": "2.10.5",
"remove-providers": "common.messaging fab git keycloak",
"run-tests": "true",
},
{
"python-version": "3.10",
"airflow-version": "2.11.0",
"remove-providers": "common.messaging fab git keycloak",
"run-tests": "true",
},
{
"python-version": "3.10",
"airflow-version": "3.0.2",
"remove-providers": "",
"run-tests": "true",
},
]

# Number of slices for low dep tests
NUMBER_OF_LOW_DEP_SLICES = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
BigQueryDeleteDataTransferConfigOperator,
)

from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS

PROJECT_ID = "id"

TRANSFER_CONFIG = {
Expand Down Expand Up @@ -73,10 +71,7 @@ def test_execute(self, mock_hook):
retry=DEFAULT,
timeout=None,
)
if AIRFLOW_V_3_0_PLUS:
ti.xcom_push.assert_called_with(key="transfer_config_id", value="1a2b3c")
else:
ti.xcom_push.assert_called_with(key="transfer_config_id", value="1a2b3c", execution_date=None)
ti.xcom_push.assert_called_with(key="transfer_config_id", value="1a2b3c")

assert "secret_access_key" not in return_value.get("params", {})
assert "access_key_id" not in return_value.get("params", {})
Expand Down Expand Up @@ -131,10 +126,7 @@ def test_execute(self, mock_hook):
retry=DEFAULT,
timeout=None,
)
if AIRFLOW_V_3_0_PLUS:
ti.xcom_push.assert_called_with(key="run_id", value="123")
else:
ti.xcom_push.assert_called_with(key="run_id", value="123", execution_date=None)
ti.xcom_push.assert_called_with(key="run_id", value="123")

@mock.patch(
f"{OPERATOR_MODULE_PATH}.BiqQueryDataTransferServiceHook",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
CloudDataCatalogUpdateTagTemplateOperator,
)

from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS

if TYPE_CHECKING:
from google.api_core.gapic_v1.method import _MethodDefault

Expand Down Expand Up @@ -163,6 +165,8 @@ def test_assert_valid_hook_call(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down Expand Up @@ -205,6 +209,8 @@ def test_assert_valid_hook_call_when_exists(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down Expand Up @@ -257,6 +263,8 @@ def test_assert_valid_hook_call(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down Expand Up @@ -301,6 +309,8 @@ def test_assert_valid_hook_call(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down Expand Up @@ -345,6 +355,8 @@ def test_assert_valid_hook_call(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down Expand Up @@ -388,6 +400,8 @@ def test_assert_valid_hook_call(self, mock_hook) -> None:
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = task # type: ignore[assignment]
result = task.execute(context=mock_context) # type: ignore[arg-type]
mock_hook.assert_called_once_with(
gcp_conn_id=TEST_GCP_CONN_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
)
from airflow.version import version

from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS

EMPTY_CONTENT = b""
MOCK_RESP_404 = httplib2.Response({"status": 404})

Expand Down Expand Up @@ -716,6 +718,8 @@ def test_execute(self, mock_gcf_hook):
)
mock_ti = mock.MagicMock()
mock_context = {"ti": mock_ti}
if not AIRFLOW_V_3_0_PLUS:
mock_context["task"] = op
op.execute(mock_context)

mock_gcf_hook.assert_called_once_with(
Expand Down