Skip to content

Commit 66673ca

Browse files
committed
test: align remote function ingress with new GCP policies
1 parent 8a10bae commit 66673ca

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

tests/system/large/functions/test_remote_function.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,12 +2629,6 @@ def generate_stats(row: pandas.Series) -> list[int]:
26292629
True,
26302630
id="set-none",
26312631
),
2632-
pytest.param(
2633-
{"cloud_function_ingress_settings": "all"},
2634-
functions_v2.ServiceConfig.IngressSettings.ALLOW_ALL,
2635-
False,
2636-
id="set-all",
2637-
),
26382632
pytest.param(
26392633
{"cloud_function_ingress_settings": "internal-only"},
26402634
functions_v2.ServiceConfig.IngressSettings.ALLOW_INTERNAL_ONLY,
@@ -2699,6 +2693,25 @@ def square(x: int) -> int:
26992693
)
27002694

27012695

2696+
@pytest.mark.flaky(retries=2, delay=120)
2697+
def test_remote_function_ingress_settings_w_all(session):
2698+
ingress_settings_args = {"cloud_function_ingress_settings": "all"}
2699+
2700+
with pytest.raises(
2701+
google.api_core.exceptions.FailedPrecondition,
2702+
match="400.*allowedIngress violated",
2703+
):
2704+
2705+
def square(x: int) -> int:
2706+
return x * x
2707+
2708+
session.remote_function(
2709+
reuse=False,
2710+
cloud_function_service_account="default",
2711+
**ingress_settings_args,
2712+
)(square)
2713+
2714+
27022715
@pytest.mark.flaky(retries=2, delay=120)
27032716
def test_remote_function_ingress_settings_unsupported(session):
27042717
with pytest.raises(

0 commit comments

Comments
 (0)