Skip to content

Commit

Permalink
SNOW-867520: fix test failure in jenkins (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-aling authored Aug 9, 2023
1 parent 10af52d commit 0a80e1f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
10 changes: 8 additions & 2 deletions tests/integ/test_stored_procedure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
11 changes: 9 additions & 2 deletions tests/integ/test_udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/integ/test_udtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 0a80e1f

Please sign in to comment.