From 69e040d6099cf8fa1b60e907939ad963b798a746 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 18 Jul 2023 11:55:09 -0700 Subject: [PATCH 1/4] Run unit tests on macos-latest Signed-off-by: eduardo apolinario --- .github/workflows/pythonbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonbuild.yml b/.github/workflows/pythonbuild.yml index bcf1bc2636..aaec09a75d 100644 --- a/.github/workflows/pythonbuild.yml +++ b/.github/workflows/pythonbuild.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ["3.8", "3.9", "3.10", "3.11"] exclude: # Ignore this test because we failed to install docker-py From 84a55f8ec76be28aeb75f17771cccce9a2969546 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 18 Jul 2023 13:35:08 -0700 Subject: [PATCH 2/4] Skip imagespec tests on macos-latest Signed-off-by: eduardo apolinario --- tests/flytekit/unit/cli/pyflyte/test_run.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/flytekit/unit/cli/pyflyte/test_run.py b/tests/flytekit/unit/cli/pyflyte/test_run.py index 1daaba5b5f..b70600a2d3 100644 --- a/tests/flytekit/unit/cli/pyflyte/test_run.py +++ b/tests/flytekit/unit/cli/pyflyte/test_run.py @@ -2,6 +2,7 @@ import json import os import pathlib +import sys import tempfile import typing from datetime import datetime, timedelta @@ -295,6 +296,11 @@ def test_list_default_arguments(wf_path): (IMAGE_SPEC, "sample.yaml", ic_result_4), ], ) +# Skip test if running on macos +@pytest.skipif( + sys.platform == "darwin", + reason="Github macos-latest image does not have docker installed as per https://github.com/orgs/community/discussions/25777", +) def test_pyflyte_run_run(mock_image, image_string, leaf_configuration_file_name, final_image_config): mock_image.return_value = "cr.flyte.org/flyteorg/flytekit:py3.9-latest" From e35e94d665d3c15cf732ac68105b4b4aed1d6b21 Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 18 Jul 2023 13:35:52 -0700 Subject: [PATCH 3/4] Use pytest.mark.skipif Signed-off-by: eduardo apolinario --- tests/flytekit/unit/cli/pyflyte/test_run.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/flytekit/unit/cli/pyflyte/test_run.py b/tests/flytekit/unit/cli/pyflyte/test_run.py index b70600a2d3..fe871b40e4 100644 --- a/tests/flytekit/unit/cli/pyflyte/test_run.py +++ b/tests/flytekit/unit/cli/pyflyte/test_run.py @@ -296,8 +296,7 @@ def test_list_default_arguments(wf_path): (IMAGE_SPEC, "sample.yaml", ic_result_4), ], ) -# Skip test if running on macos -@pytest.skipif( +@pytest.mark.skipif( sys.platform == "darwin", reason="Github macos-latest image does not have docker installed as per https://github.com/orgs/community/discussions/25777", ) From b0c577c19edcb8069610d0c307a27f3d894743af Mon Sep 17 00:00:00 2001 From: eduardo apolinario Date: Tue, 18 Jul 2023 13:41:27 -0700 Subject: [PATCH 4/4] Only skip if running in CI. Signed-off-by: eduardo apolinario --- tests/flytekit/unit/cli/pyflyte/test_run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/flytekit/unit/cli/pyflyte/test_run.py b/tests/flytekit/unit/cli/pyflyte/test_run.py index fe871b40e4..f7cf2f4662 100644 --- a/tests/flytekit/unit/cli/pyflyte/test_run.py +++ b/tests/flytekit/unit/cli/pyflyte/test_run.py @@ -297,7 +297,7 @@ def test_list_default_arguments(wf_path): ], ) @pytest.mark.skipif( - sys.platform == "darwin", + os.environ["GITHUB_ACTIONS"] == "true" and sys.platform == "darwin", reason="Github macos-latest image does not have docker installed as per https://github.com/orgs/community/discussions/25777", ) def test_pyflyte_run_run(mock_image, image_string, leaf_configuration_file_name, final_image_config):