diff --git a/integration/combination/test_api_with_authorizer_apikey.py b/integration/combination/test_api_with_authorizer_apikey.py index f7d58237b..5f0190e2b 100644 --- a/integration/combination/test_api_with_authorizer_apikey.py +++ b/integration/combination/test_api_with_authorizer_apikey.py @@ -6,10 +6,10 @@ from integration.helpers.resource import current_region_does_not_support -from integration.config.service_names import REST_API +from integration.config.service_names import REST_API, API_KEY -@skipIf(current_region_does_not_support([REST_API]), "RestApi is not supported in this testing region") +@skipIf(current_region_does_not_support([REST_API, API_KEY]), "RestApi/ApiKey is not supported in this testing region") class TestApiWithAuthorizerApiKey(BaseTest): def test_authorizer_apikey(self): self.create_and_verify_stack("combination/api_with_authorizer_apikey") diff --git a/integration/combination/test_api_with_authorizers.py b/integration/combination/test_api_with_authorizers.py index 3d0ce02dc..a34ef6258 100644 --- a/integration/combination/test_api_with_authorizers.py +++ b/integration/combination/test_api_with_authorizers.py @@ -4,10 +4,12 @@ from integration.helpers.deployer.utils.retry import retry from integration.helpers.exception import StatusCodeError from integration.helpers.resource import current_region_does_not_support -from integration.config.service_names import COGNITO +from integration.config.service_names import API_KEY, COGNITO, REST_API -@skipIf(current_region_does_not_support([COGNITO]), "Cognito is not supported in this testing region") +@skipIf( + current_region_does_not_support([COGNITO, API_KEY, REST_API]), "Cognito is not supported in this testing region" +) class TestApiWithAuthorizers(BaseTest): def test_authorizers_min(self): self.create_and_verify_stack("combination/api_with_authorizers_min") diff --git a/integration/combination/test_api_with_gateway_responses.py b/integration/combination/test_api_with_gateway_responses.py index 39979e016..2554cbb34 100644 --- a/integration/combination/test_api_with_gateway_responses.py +++ b/integration/combination/test_api_with_gateway_responses.py @@ -5,13 +5,14 @@ from integration.helpers.base_test import BaseTest from integration.helpers.resource import current_region_does_not_support -from integration.config.service_names import GATEWAY_RESPONSES +from integration.config.service_names import GATEWAY_RESPONSES, REST_API LOG = logging.getLogger(__name__) @skipIf( - current_region_does_not_support([GATEWAY_RESPONSES]), "GatewayResponses is not supported in this testing region" + current_region_does_not_support([GATEWAY_RESPONSES, REST_API]), + "GatewayResponses is not supported in this testing region", ) class TestApiWithGatewayResponses(BaseTest): def test_gateway_responses(self): diff --git a/integration/combination/test_api_with_usage_plan.py b/integration/combination/test_api_with_usage_plan.py index b252338a9..50b699482 100644 --- a/integration/combination/test_api_with_usage_plan.py +++ b/integration/combination/test_api_with_usage_plan.py @@ -2,10 +2,10 @@ from integration.helpers.base_test import BaseTest from integration.helpers.resource import current_region_does_not_support -from integration.config.service_names import USAGE_PLANS +from integration.config.service_names import USAGE_PLANS, REST_API -@skipIf(current_region_does_not_support([USAGE_PLANS]), "UsagePlans is not supported in this testing region") +@skipIf(current_region_does_not_support([USAGE_PLANS, REST_API]), "UsagePlans is not supported in this testing region") class TestApiWithUsagePlan(BaseTest): def test_api_with_usage_plans(self): self.create_and_verify_stack("combination/api_with_usage_plan") diff --git a/integration/config/service_names.py b/integration/config/service_names.py index e3651aa47..f26da0930 100644 --- a/integration/config/service_names.py +++ b/integration/config/service_names.py @@ -33,3 +33,4 @@ LAMBDA_ENV_VARS = "LambdaEnvVars" EVENT_INVOKE_CONFIG = "EventInvokeConfig" EPHEMERAL_STORAGE = "EphemeralStorage" +API_KEY = "ApiKey" diff --git a/integration/conftest.py b/integration/conftest.py index fb6cca5ae..98afb1803 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -216,7 +216,9 @@ def _stack_exists(stack_name): cloudformation = boto3.resource("cloudformation") stack = cloudformation.Stack(stack_name) try: - stack.stack_status + status = stack.stack_status + if status == "REVIEW_IN_PROGRESS": + return False except ClientError as ex: if "does not exist" in str(ex): return False diff --git a/integration/helpers/base_test.py b/integration/helpers/base_test.py index 2ba79e1ad..b46263948 100644 --- a/integration/helpers/base_test.py +++ b/integration/helpers/base_test.py @@ -451,8 +451,8 @@ def verify_stack(self, end_state="CREATE_COMPLETE"): self.fail(error) @retry( - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=4, max=10) + wait_random(0, 1), + stop=stop_after_attempt(6), + wait=wait_exponential(multiplier=1, min=16, max=64) + wait_random(0, 1), retry=retry_if_exception_type(StatusCodeError), after=after_log(LOG, logging.WARNING), reraise=True, @@ -480,8 +480,8 @@ def verify_get_request_response(self, url, expected_status_code, headers=None): return response @retry( - stop=stop_after_attempt(3), - wait=wait_exponential(multiplier=1, min=4, max=10) + wait_random(0, 1), + stop=stop_after_attempt(6), + wait=wait_exponential(multiplier=1, min=16, max=64) + wait_random(0, 1), retry=retry_if_exception_type(StatusCodeError), after=after_log(LOG, logging.WARNING), reraise=True,