Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integration/combination/test_api_with_authorizer_apikey.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 4 additions & 2 deletions integration/combination/test_api_with_authorizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 3 additions & 2 deletions integration/combination/test_api_with_gateway_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions integration/combination/test_api_with_usage_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions integration/config/service_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@
LAMBDA_ENV_VARS = "LambdaEnvVars"
EVENT_INVOKE_CONFIG = "EventInvokeConfig"
EPHEMERAL_STORAGE = "EphemeralStorage"
API_KEY = "ApiKey"
4 changes: 3 additions & 1 deletion integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions integration/helpers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down