From d4a4b5715b5f07d0079a4eacd6fd6f937c00553f Mon Sep 17 00:00:00 2001 From: MEPalma <64580864+MEPalma@users.noreply.github.com> Date: Tue, 29 Apr 2025 09:34:15 +0200 Subject: [PATCH] fix multiregion mock test --- .../stepfunctions/v2/mocking/test_base_scenarios.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/aws/services/stepfunctions/v2/mocking/test_base_scenarios.py b/tests/aws/services/stepfunctions/v2/mocking/test_base_scenarios.py index e7a4736d79590..6267001f37700 100644 --- a/tests/aws/services/stepfunctions/v2/mocking/test_base_scenarios.py +++ b/tests/aws/services/stepfunctions/v2/mocking/test_base_scenarios.py @@ -2,6 +2,7 @@ from localstack_snapshot.snapshots.transformer import JsonpathTransformer, RegexTransformer +import localstack.testing.config from localstack import config from localstack.aws.api.lambda_ import Runtime from localstack.aws.api.stepfunctions import HistoryEventType @@ -76,8 +77,11 @@ def test_lambda_invoke( } mock_config_file_path = mock_config_file(mock_config) monkeypatch.setattr(config, "SFN_MOCK_CONFIG", mock_config_file_path) + # Insert the test environment's region name into this mock ARN + # to maintain snapshot compatibility across multi-region tests. + test_region_name = localstack.testing.config.TEST_AWS_REGION_NAME template["States"]["step1"]["Resource"] = ( - f"arn:aws:lambda:us-east-1:111111111111:function:{function_name}" + f"arn:aws:lambda:{test_region_name}:111111111111:function:{function_name}" ) definition = json.dumps(template) create_and_record_mocked_execution(