Skip to content

Commit d1d9491

Browse files
authored
Revert last change and Re-add location exclusion in connector tests (#2832)
Co-authored-by: Gavin Zhang <[email protected]>
1 parent 46352d6 commit d1d9491

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

integration/combination/test_connectors.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from unittest.case import skipIf
2-
31
from time import sleep
42
from unittest import SkipTest
53
from parameterized import parameterized
64
from tenacity import retry, stop_after_attempt, retry_if_exception
75
from integration.conftest import clean_bucket
86
from integration.helpers.base_test import S3_BUCKET_PREFIX, BaseTest
9-
from integration.helpers.resource import generate_suffix, current_region_does_not_support
10-
from integration.config.service_names import LOCATION
7+
from integration.helpers.resource import generate_suffix
118

129
retry_once = retry(
1310
stop=stop_after_attempt(2),
@@ -16,10 +13,6 @@
1613
)
1714

1815

19-
@skipIf(
20-
current_region_does_not_support([LOCATION]),
21-
"Location service is not supported in this testing region",
22-
)
2316
class TestConnectors(BaseTest):
2417
def tearDown(self):
2518
# Some tests will create items in S3 Bucket, which result in stack DELETE_FAILED state

integration/helpers/resource.py

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
REST_API,
1111
S3_EVENTS,
1212
SQS,
13+
LOCATION,
1314
SCHEDULE_EVENT,
1415
STATE_MACHINE_INLINE_DEFINITION,
1516
)
@@ -222,6 +223,7 @@ def _resource_using_s3_events(resource: Dict[str, Any]) -> bool:
222223
S3_EVENTS: lambda template_dict, cfn_resource_types: any(
223224
_resource_using_s3_events(resource) for resource in template_dict.get("Resources", {}).values()
224225
),
226+
LOCATION: lambda template_dict, cfn_resource_types: "AWS::Location::PlaceIndex" in cfn_resource_types,
225227
}
226228

227229

integration/resources/templates/combination/connector_function_to_location_place_index.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Resources:
3535
)
3636
Environment:
3737
Variables:
38-
LOCATION_INDEX: !Sub ${AWS::StackName}-PlaceIndex
38+
LOCATION_INDEX: !Sub ${AWS::StackName}-PI
3939

4040

4141
MyPlace:
4242
Type: AWS::Location::PlaceIndex
4343
Properties:
4444
DataSource: Here
45-
IndexName: !Sub ${AWS::StackName}-PlaceIndex
45+
IndexName: !Sub ${AWS::StackName}-PI
4646

4747
MyConnector:
4848
Type: AWS::Serverless::Connector

0 commit comments

Comments
 (0)