From 8d939f7d0d9a2dd95263de26a954dc581d34d9dc Mon Sep 17 00:00:00 2001 From: Achal Shah Date: Fri, 10 Jun 2022 13:47:54 -0700 Subject: [PATCH] allow tests to run locally but not on CI Signed-off-by: Achal Shah --- .../registration/test_sql_registry.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sdk/python/tests/integration/registration/test_sql_registry.py b/sdk/python/tests/integration/registration/test_sql_registry.py index 1fe9ff5cec..c483a7c46f 100644 --- a/sdk/python/tests/integration/registration/test_sql_registry.py +++ b/sdk/python/tests/integration/registration/test_sql_registry.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +import os import sys from datetime import timedelta @@ -101,7 +102,8 @@ def mysql_registry(): @pytest.mark.skipif( - sys.platform == "darwin", reason="does not run on mac github actions" + sys.platform == "darwin" and "GITHUB_REF" in os.environ, + reason="does not run on mac github actions", ) @pytest.mark.parametrize( "sql_registry", [lazy_fixture("mysql_registry"), lazy_fixture("pg_registry")], @@ -143,7 +145,8 @@ def test_apply_entity_success(sql_registry): @pytest.mark.skipif( - sys.platform == "darwin", reason="does not run on mac github actions" + sys.platform == "darwin" and "GITHUB_REF" in os.environ, + reason="does not run on mac github actions", ) @pytest.mark.parametrize( "sql_registry", [lazy_fixture("mysql_registry"), lazy_fixture("pg_registry")], @@ -217,7 +220,8 @@ def test_apply_feature_view_success(sql_registry): @pytest.mark.skipif( - sys.platform == "darwin", reason="does not run on mac github actions" + sys.platform == "darwin" and "GITHUB_REF" in os.environ, + reason="does not run on mac github actions", ) @pytest.mark.parametrize( "sql_registry", [lazy_fixture("mysql_registry"), lazy_fixture("pg_registry")], @@ -299,7 +303,8 @@ def location_features_from_push(inputs: pd.DataFrame) -> pd.DataFrame: @pytest.mark.skipif( - sys.platform == "darwin", reason="does not run on mac github actions" + sys.platform == "darwin" and "GITHUB_REF" in os.environ, + reason="does not run on mac github actions", ) @pytest.mark.parametrize( "sql_registry", [lazy_fixture("mysql_registry"), lazy_fixture("pg_registry")], @@ -421,7 +426,8 @@ def odfv1(feature_df: pd.DataFrame) -> pd.DataFrame: @pytest.mark.skipif( - sys.platform == "darwin", reason="does not run on mac github actions" + sys.platform == "darwin" and "GITHUB_REF" in os.environ, + reason="does not run on mac github actions", ) @pytest.mark.integration @pytest.mark.parametrize(