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 70e17f6e00 Mark `extending/add-build-essential-extend/Dockerfile` 
docker example test as XFAIL (#38978)
70e17f6e00 is described below

commit 70e17f6e0010e369a4b2d05869c66ff902c3ba42
Author: Andrey Anshin <andrey.ans...@taragol.is>
AuthorDate: Sun Apr 14 17:11:36 2024 +0400

    Mark `extending/add-build-essential-extend/Dockerfile` docker example test 
as XFAIL (#38978)
---
 .github/workflows/additional-prod-image-tests.yml  |  2 +-
 .../test_examples_of_prod_image_building.py        | 28 ++++++++++++++++++----
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/additional-prod-image-tests.yml 
b/.github/workflows/additional-prod-image-tests.yml
index b7cfc0067b..a584be8cf1 100644
--- a/.github/workflows/additional-prod-image-tests.yml
+++ b/.github/workflows/additional-prod-image-tests.yml
@@ -93,7 +93,7 @@ jobs:
 
   test-examples-of-prod-image-building:
     timeout-minutes: 60
-    name: "Test examples of POD image building"
+    name: "Test examples of PROD image building"
     runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
     env:
       GITHUB_REPOSITORY: ${{ github.repository }}
diff --git a/docker_tests/test_examples_of_prod_image_building.py 
b/docker_tests/test_examples_of_prod_image_building.py
index 6931a78b79..2e99b69280 100644
--- a/docker_tests/test_examples_of_prod_image_building.py
+++ b/docker_tests/test_examples_of_prod_image_building.py
@@ -52,10 +52,30 @@ def test_shell_script_example(script_file):
     run_command(["bash", script_file])
 
 
-@pytest.mark.parametrize("dockerfile", 
glob.glob(f"{DOCKER_EXAMPLES_DIR}/**/Dockerfile", recursive=True))
-def test_dockerfile_example(dockerfile, tmp_path):
-    rel_dockerfile_path = Path(dockerfile).relative_to(DOCKER_EXAMPLES_DIR)
-    image_name = str(rel_dockerfile_path).lower().replace("/", "-")
+def docker_examples(directory: Path, xfails: list[str] | None = None):
+    xfails = xfails or []
+    result = []
+    for filepath in sorted(directory.rglob("**/Dockerfile")):
+        markers = []
+        rel_path = filepath.relative_to(directory).as_posix()
+        if rel_path in xfails:
+            markers.append(pytest.mark.xfail)
+        result.append(pytest.param(filepath, rel_path, marks=markers, 
id=rel_path))
+    return result
+
+
+@pytest.mark.parametrize(
+    "dockerfile, relative_path",
+    docker_examples(
+        DOCKER_EXAMPLES_DIR,
+        xfails=[
+            # FIXME https://github.com/apache/airflow/issues/38988
+            "extending/add-build-essential-extend/Dockerfile",
+        ],
+    ),
+)
+def test_dockerfile_example(dockerfile, relative_path, tmp_path):
+    image_name = relative_path.lower().replace("/", "-")
     content = Path(dockerfile).read_text()
     test_image = os.environ.get("TEST_IMAGE", get_latest_airflow_image())
 

Reply via email to