8000 Clarify test skip for legacy local executor · localstack/localstack@9df0b23 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9df0b23

Browse files
committed
Clarify test skip for legacy local executor
1 parent 19463cf commit 9df0b23

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

localstack/testing/aws/lambda_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
from typing import Literal
44

5+
from localstack.services.awslambda.lambda_api import use_docker
56
from localstack.utils.common import to_str
67
from localstack.utils.sync import ShortCircuitWaitException, retry
78
from localstack.utils.testutil import get_lambda_log_events
@@ -116,6 +117,14 @@ def get_events():
116117
return retry(get_events, retries=retries, sleep_before=2)
117118

118119

120+
def is_old_local_executor() -> bool:
121+
"""Returns True if running in local executor mode and False otherwise.
122+
The new provider ignores the LAMBDA_EXECUTOR flag and `not use_docker()` covers the fallback case if
123+
the Docker socket is not available.
124+
"""
125+
return is_old_provider() and not use_docker()
126+
127+
119128
def is_old_provider():
120129
return os.environ.get("TEST_TARGET") != "AWS_CLOUD" and os.environ.get(
121130
"PROVIDER_OVERRIDE_LAMBDA"

tests/integration/awslambda/test_lambda.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from localstack.testing.aws.lambda_utils import (
1717
concurrency_update_done,
1818
get_invoke_init_type,
19+
is_old_local_executor,
1920
is_old_provider,
2021
update_done,
2122
)
@@ -380,8 +381,8 @@ def test_runtime_introspection_arm(self, lambda_client, create_lambda_function,
380381

381382
@pytest.mark.skipif(is_old_provider(), reason="unsupported in old provider")
382383
@pytest.mark.skipif(
383-
not use_docker(),
384-
reason="Monkeypatching of Docker-related flag not applicable if run locally",
384+
is_old_local_executor(),
385+
reason="Monkey-patching of Docker flags is not applicable because no new container is spawned",
385386
)
386387
@pytest.mark.only_localstack
387388
def test_ignore_architecture(

0 commit comments

Comments
 (0)
0