diff --git a/tests/integ/test_stored_procedure.py b/tests/integ/test_stored_procedure.py index 3523cdd581..faafefbc0c 100644 --- a/tests/integ/test_stored_procedure.py +++ b/tests/integ/test_stored_procedure.py @@ -46,7 +46,13 @@ StructField, StructType, ) -from tests.utils import IS_IN_STORED_PROC, TempObjectType, TestFiles, Utils +from tests.utils import ( + IS_IN_STORED_PROC, + IS_NOT_ON_GITHUB, + TempObjectType, + TestFiles, + Utils, +) pytestmark = pytest.mark.udf @@ -1206,7 +1212,7 @@ def test_anonymous_stored_procedure(session): assert add_sp(1, 2) == 3 -@pytest.mark.skipif(IS_IN_STORED_PROC, reason="need resources") +@pytest.mark.skipif(IS_NOT_ON_GITHUB, reason="need resources") def test_sp_external_access_integration(session, db_parameters): """ This test requires: diff --git a/tests/integ/test_udf.py b/tests/integ/test_udf.py index fa2a7244c5..624f43ff77 100644 --- a/tests/integ/test_udf.py +++ b/tests/integ/test_udf.py @@ -80,7 +80,14 @@ Variant, VariantType, ) -from tests.utils import IS_IN_STORED_PROC, TempObjectType, TestData, TestFiles, Utils +from tests.utils import ( + IS_IN_STORED_PROC, + IS_NOT_ON_GITHUB, + TempObjectType, + TestData, + TestFiles, + Utils, +) pytestmark = pytest.mark.udf @@ -2264,7 +2271,7 @@ def f(x: Timestamp) -> Timestamp[int]: return x -@pytest.mark.skipif(IS_IN_STORED_PROC, reason="need resources") +@pytest.mark.skipif(IS_NOT_ON_GITHUB, reason="need resources") def test_udf_external_access_integration(session, db_parameters): """ This test requires: diff --git a/tests/integ/test_udtf.py b/tests/integ/test_udtf.py index 8e24799e3c..d4435072ef 100644 --- a/tests/integ/test_udtf.py +++ b/tests/integ/test_udtf.py @@ -25,7 +25,7 @@ StructType, ) from snowflake.snowpark.udtf import UserDefinedTableFunction -from tests.utils import IS_IN_STORED_PROC, TestFiles, Utils +from tests.utils import IS_IN_STORED_PROC, IS_NOT_ON_GITHUB, TestFiles, Utils # Python 3.8 needs to use typing.Iterable because collections.abc.Iterable is not subscriptable # Python 3.9 can use both @@ -636,7 +636,7 @@ def end_partition(self) -> Iterable[Tuple[int]]: Utils.check_answer(df, [Row(INT_=1)]) -@pytest.mark.skipif(IS_IN_STORED_PROC, reason="need resources") +@pytest.mark.skipif(IS_NOT_ON_GITHUB, reason="need resources") def test_udtf_external_access_integration(session, db_parameters): """ This test requires: diff --git a/tests/utils.py b/tests/utils.py index 7c90c9faeb..b9bb5d40ce 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -45,6 +45,7 @@ IS_LINUX = platform.system() == "Linux" IS_UNIX = IS_LINUX or IS_MACOS IS_IN_STORED_PROC = is_in_stored_procedure() +IS_NOT_ON_GITHUB = os.getenv("GITHUB_ACTIONS") != "true" # this env variable is set in regression test IS_IN_STORED_PROC_LOCALFS = IS_IN_STORED_PROC and os.getenv("IS_LOCAL_FS")