Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Commit 5b271d7

Browse files
K8s tests: Add requires_in_process marker in only_localstack tests where needed
1 parent a01a933 commit 5b271d7

17 files changed

Lines changed: 66 additions & 0 deletions

tests/aws/services/acm/test_acm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def _cert_has_required_fields() -> bool:
8585
result = aws_client.acm.describe_certificate(CertificateArn=certificate_arn)
8686
snapshot.match("describe-certificate", result)
8787

88+
@markers.requires_in_process
8889
@markers.aws.needs_fixing
8990
def test_boto_wait_for_certificate_validation(
9091
self, acm_request_certificate, aws_client, monkeypatch

tests/aws/services/apigateway/test_apigateway_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ def test_api_gateway_lambda_integration_aws_type(
301301
@pytest.mark.parametrize("disable_custom_cors", [True, False])
302302
@pytest.mark.parametrize("origin", ["http://allowed", "http://denied"])
303303
@markers.aws.only_localstack
304+
@markers.requires_in_process
304305
def test_invoke_endpoint_cors_headers(
305306
self, url_type, disable_custom_cors, origin, monkeypatch, aws_client
306307
):

tests/aws/services/ec2/test_ec2.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ def test_create_subnet_with_custom_id_and_vpc_id(self, cleanups, aws_client, cre
668668
assert subnet["Tags"][0]["Key"] == TAG_KEY_CUSTOM_ID
669669
assert subnet["Tags"][0]["Value"] == custom_subnet_id
670670

671+
@markers.requires_in_process
671672
@markers.aws.only_localstack
672673
@pytest.mark.parametrize("strategy", ["tag", "id_manager"])
673674
@pytest.mark.parametrize("default_vpc", [True, False])
@@ -1006,6 +1007,7 @@ def test_pickle_ec2_backend(pickle_backends, aws_client):
10061007
assert pickle_backends(ec2_backends)
10071008

10081009

1010+
@markers.requires_in_process
10091011
@markers.aws.only_localstack
10101012
def test_create_specific_vpc_id(account_id, region_name, create_vpc, set_resource_custom_id):
10111013
cidr_block = "10.0.0.0/16"

tests/aws/services/events/test_events_targets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
class TestEventsTargetApiDestination:
4343
# TODO validate against AWS & use common fixtures
44+
@markers.requires_in_process # uses pytest httpserver
4445
@markers.aws.only_localstack
4546
@pytest.mark.skipif(is_old_provider(), reason="not supported by the old provider")
4647
@pytest.mark.parametrize("auth", API_DESTINATION_AUTHS)

tests/aws/services/firehose/test_firehose.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def handler(event, context):
3838

3939
@pytest.mark.parametrize("lambda_processor_enabled", [True, False])
4040
@markers.aws.unknown
41+
@markers.requires_in_process # uses pytest httpserver
4142
def test_kinesis_firehose_http(
4243
aws_client,
4344
lambda_processor_enabled: bool,

tests/aws/services/lambda_/test_lambda.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def _check_print_in_logs():
264264

265265
retry(_check_print_in_logs, retries=10)
266266

267+
@markers.requires_in_process
267268
@markers.aws.only_localstack
268269
def test_lambda_too_large_response_but_with_custom_limit(
269270
self, caplog, create_lambda_function, aws_client, monkeypatch
@@ -1970,6 +1971,7 @@ def test_lambda_runtime_wrapper_not_found(self, aws_client, create_lambda_functi
19701971
)
19711972
snapshot.match("invocation_error", result)
19721973

1974+
@markers.requires_in_process
19731975
@markers.aws.only_localstack(
19741976
reason="Can only induce Lambda-internal Docker error in LocalStack"
19751977
)
@@ -1999,6 +2001,7 @@ def test_lambda_runtime_startup_timeout(
19992001
r"retries: \d\): \[[^]]*\] Timeout while starting up lambda environment .*"
20002002
)
20012003

2004+
@markers.requires_in_process
20022005
@markers.aws.only_localstack(
20032006
reason="Can only induce Lambda-internal Docker error in LocalStack"
20042007
)

tests/aws/services/lambda_/test_lambda_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4799,6 +4799,7 @@ def test_create_url_config_custom_id_tag(self, create_lambda_function, aws_clien
47994799
# region changes, https vs http, etc
48004800
assert f"://{custom_id_value}.lambda-url." in url_config_created["FunctionUrl"]
48014801

4802+
@markers.requires_in_process
48024803
@markers.aws.only_localstack
48034804
def test_create_url_config_custom_id_tag_invalid_id(
48044805
self, create_lambda_function, aws_client, caplog
@@ -6855,6 +6856,7 @@ def test_layer_policy_lifecycle(
68556856
"get_layer_version_policy_postdeletes2", get_layer_version_policy_postdeletes2
68566857
)
68576858

6859+
@markers.requires_in_process
68586860
@markers.aws.only_localstack(reason="Deterministic id generation is LS only")
68596861
def test_layer_deterministic_version(
68606862
self, dummylayer, cleanups, aws_client, account_id, region_name, set_resource_custom_id

tests/aws/services/lambda_/test_lambda_developer_tools.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class TestHotReloading:
3636
ids=["nodejs20.x", "python3.12"],
3737
)
3838
@markers.aws.only_localstack
39+
@markers.requires_in_process
3940
def test_hot_reloading(
4041
self,
4142
create_lambda_function_aws,
@@ -165,6 +166,7 @@ def test_hot_reloading_error_path_not_absolute(
165166
Runtime=Runtime.python3_12,
166167
)
167168

169+
@markers.requires_in_process
168170
@markers.aws.only_localstack
169171
def test_hot_reloading_environment_placeholder(
170172
self, create_lambda_function_aws, lambda_su_role, cleanups, aws_client, monkeypatch
@@ -198,6 +200,7 @@ def test_hot_reloading_environment_placeholder(
198200

199201

200202
class TestDockerFlags:
203+
@markers.requires_in_process
201204
@markers.aws.only_localstack
202205
def test_additional_docker_flags(self, create_lambda_function, monkeypatch, aws_client):
203206
env_value = short_uid()
@@ -214,6 +217,7 @@ def test_additional_docker_flags(self, create_lambda_function, monkeypatch, aws_
214217
result_data = json.load(result["Payload"])
215218
assert {"Hello": env_value} == result_data
216219

220+
@markers.requires_in_process
217221
@markers.aws.only_localstack
218222
def test_lambda_docker_networks(self, lambda_su_role, monkeypatch, aws_client, cleanups):
219223
function_name = f"test-network-{short_uid()}"

tests/aws/services/opensearch/test_opensearch.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ def test_search(self, opensearch_endpoint, opensearch_document_path):
640640
f"search unsuccessful({response.status_code}): {response.text}"
641641
)
642642

643+
@markers.requires_in_process
643644
@markers.aws.only_localstack
644645
def test_endpoint_strategy_path(self, monkeypatch, opensearch_create_domain, aws_client):
645646
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "path")
@@ -653,6 +654,7 @@ def test_endpoint_strategy_path(self, monkeypatch, opensearch_create_domain, aws
653654
endpoint = status["Endpoint"]
654655
assert endpoint.endswith(f"/{domain_name}")
655656

657+
@markers.requires_in_process
656658
@markers.aws.only_localstack
657659
def test_endpoint_strategy_port(self, monkeypatch, opensearch_create_domain, aws_client):
658660
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "port")
@@ -688,6 +690,7 @@ def test_cloudformation_deployment(self, deploy_cfn_template, aws_client):
688690

689691
@markers.skip_offline
690692
class TestEdgeProxiedOpensearchCluster:
693+
@markers.requires_in_process
691694
@markers.aws.only_localstack
692695
def test_route_through_edge(self):
693696
cluster_id = f"domain-{short_uid()}"
@@ -784,6 +787,7 @@ def test_custom_endpoint_disabled(
784787

785788
@markers.skip_offline
786789
class TestMultiClusterManager:
790+
@markers.requires_in_process
787791
@markers.aws.only_localstack
788792
def test_multi_cluster(self, account_id, monkeypatch):
789793
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "domain")
@@ -832,6 +836,7 @@ def test_multi_cluster(self, account_id, monkeypatch):
832836

833837
@markers.skip_offline
834838
class TestMultiplexingClusterManager:
839+
@markers.requires_in_process
835840
@markers.aws.only_localstack
836841
def test_multiplexing_cluster(self, account_id, monkeypatch):
837842
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "domain")
@@ -880,6 +885,7 @@ def test_multiplexing_cluster(self, account_id, monkeypatch):
880885

881886
@markers.skip_offline
882887
class TestSingletonClusterManager:
888+
@markers.requires_in_process
883889
@markers.aws.only_localstack
884890
def test_endpoint_strategy_port_singleton_cluster(self, account_id, monkeypatch):
885891
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "port")
@@ -926,6 +932,7 @@ def test_endpoint_strategy_port_singleton_cluster(self, account_id, monkeypatch)
926932

927933
@markers.skip_offline
928934
class TestCustomBackendManager:
935+
@markers.requires_in_process
929936
@markers.aws.only_localstack
930937
def test_custom_backend(self, account_id, httpserver, monkeypatch):
931938
monkeypatch.setattr(config, "OPENSEARCH_ENDPOINT_STRATEGY", "domain")
@@ -992,6 +999,7 @@ def test_custom_backend(self, account_id, httpserver, monkeypatch):
992999

9931000
httpserver.check()
9941001

1002+
@markers.requires_in_process
9951003
@markers.aws.only_localstack
9961004
def test_custom_backend_with_custom_endpoint(
9971005
self,

tests/aws/services/s3/test_s3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6354,6 +6354,7 @@ def test_put_object(self, s3_bucket, snapshot, aws_client):
63546354
assert response["Body"].read() == b"something"
63556355
snapshot.match("get_object", response)
63566356

6357+
@markers.requires_in_process
63576358
@markers.aws.only_localstack
63586359
def test_get_request_expires_ignored_if_validation_disabled(
63596360
self, s3_bucket, monkeypatch, patch_s3_skip_signature_validation_false, aws_client

0 commit comments

Comments
 (0)