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 c3719d966e Make environment tests for breeze branch-agnostic (#35860)
c3719d966e is described below
commit c3719d966ee07b192d0fcc327eb300af569a6e51
Author: Jarek Potiuk <[email protected]>
AuthorDate: Sun Nov 26 12:42:50 2023 +0100
Make environment tests for breeze branch-agnostic (#35860)
The new tests in breeze depended implicitly on the fact they were
running in `main` branch, but when run in v2*test, they should
use the AIRFLOW_BRANCH as the expected branch rather than `main`
explicitly - otherwise the tests fail.
This PR makes the test branch-agnostic, no matter what branch they
run in, they should expect the right branch.
---
dev/breeze/tests/test_shell_params.py | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/dev/breeze/tests/test_shell_params.py
b/dev/breeze/tests/test_shell_params.py
index 4a39126d55..2ce10ba66a 100644
--- a/dev/breeze/tests/test_shell_params.py
+++ b/dev/breeze/tests/test_shell_params.py
@@ -22,6 +22,7 @@ from unittest.mock import patch
import pytest
from rich.console import Console
+from airflow_breeze.branch_defaults import AIRFLOW_BRANCH
from airflow_breeze.params.shell_params import ShellParams
console = Console(width=400, color_system="standard")
@@ -34,9 +35,9 @@ console = Console(width=400, color_system="standard")
{},
{"python": 3.12},
{
- "DEFAULT_BRANCH": "main",
- "AIRFLOW_CI_IMAGE":
"ghcr.io/apache/airflow/main/ci/python3.12",
- "AIRFLOW_CI_IMAGE_WITH_TAG":
"ghcr.io/apache/airflow/main/ci/python3.12",
+ "DEFAULT_BRANCH": AIRFLOW_BRANCH,
+ "AIRFLOW_CI_IMAGE":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.12",
+ "AIRFLOW_CI_IMAGE_WITH_TAG":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.12",
"PYTHON_MAJOR_MINOR_VERSION": "3.12",
},
id="python3.12",
@@ -45,8 +46,8 @@ console = Console(width=400, color_system="standard")
{},
{"python": 3.9},
{
- "AIRFLOW_CI_IMAGE": "ghcr.io/apache/airflow/main/ci/python3.9",
- "AIRFLOW_CI_IMAGE_WITH_TAG":
"ghcr.io/apache/airflow/main/ci/python3.9",
+ "AIRFLOW_CI_IMAGE":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.9",
+ "AIRFLOW_CI_IMAGE_WITH_TAG":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.9",
"PYTHON_MAJOR_MINOR_VERSION": "3.9",
},
id="python3.9",
@@ -55,8 +56,8 @@ console = Console(width=400, color_system="standard")
{},
{"python": 3.9, "image_tag": "a_tag"},
{
- "AIRFLOW_CI_IMAGE": "ghcr.io/apache/airflow/main/ci/python3.9",
- "AIRFLOW_CI_IMAGE_WITH_TAG":
"ghcr.io/apache/airflow/main/ci/python3.9:a_tag",
+ "AIRFLOW_CI_IMAGE":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.9",
+ "AIRFLOW_CI_IMAGE_WITH_TAG":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.9:a_tag",
"PYTHON_MAJOR_MINOR_VERSION": "3.9",
},
id="With tag",
@@ -72,11 +73,11 @@ console = Console(width=400, color_system="standard")
id="With release branch",
),
pytest.param(
- {"DEFAULT_BRANCH": "v2-8-test"},
+ {"DEFAULT_BRANCH": "v2-4-test"},
{},
{
- "DEFAULT_BRANCH": "main", # DEFAULT_BRANCH is overridden from
sources
- "AIRFLOW_CI_IMAGE": "ghcr.io/apache/airflow/main/ci/python3.8",
+ "DEFAULT_BRANCH": AIRFLOW_BRANCH, # DEFAULT_BRANCH is
overridden from sources
+ "AIRFLOW_CI_IMAGE":
f"ghcr.io/apache/airflow/{AIRFLOW_BRANCH}/ci/python3.8",
"PYTHON_MAJOR_MINOR_VERSION": "3.8",
},
id="Branch variable from sources not from original env",