Skip to content
Merged
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
16 changes: 16 additions & 0 deletions integration/single/test_function_with_http_api_and_auth.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
import logging
from unittest.case import skipIf

from tenacity import stop_after_attempt, retry_if_exception_type, after_log, wait_exponential, retry, wait_random

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support

LOG = logging.getLogger(__name__)


@skipIf(current_region_does_not_support(["HttpApi"]), "HttpApi is not supported in this testing region")
class TestFunctionWithHttpApiAndAuth(BaseTest):
"""
AWS::Lambda::Function tests with http api events and auth
"""

@retry(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could there be issues surrounding the fact that the stacks were not cleaned up correctly, is that a possibility here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope for each stack the stack name is generated with a unique hash, random.choice(string.ascii_lowercase) for i in range(RANDOM_SUFFIX_LENGTH), so a failed clean up will never affect stack creation

stop=stop_after_attempt(5),
wait=wait_exponential(multiplier=1, min=4, max=10) + wait_random(0, 1),
retry=retry_if_exception_type(AssertionError),
after=after_log(LOG, logging.WARNING),
reraise=True,
)
def test_function_with_http_api_and_auth(self):
# If the request is not signed, which none of the below are, IAM will respond with a "Forbidden" message.
# We are not testing that IAM auth works here, we are simply testing if it was applied.
Expand Down