Enable AWSI Automation Tests (#1330)
* Add AWS AutomatedTesting levels * Update AWSCoreConfiguration to use default profile * Update lambda name * Add cdk update command before tests run * Update global cdk version before runnign tests. * Add npm update command * More cdk changes * More cdk changes * Shortening project names for cdk * increase timeout for AWSTests * Add comments * Set AWSTests to periodic test suite * Update logic to re install cdk and deploy bootstrap * change version to list to catch version mismatch * Move AWS fixtures to module directory scope * Fixing issues with cdk utils * Add cdk setup to be called on cdk fixture function
This commit is contained in:
@@ -8,11 +8,12 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
import boto3
|
||||
import pytest
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logging.getLogger('boto').setLevel(logging.CRITICAL)
|
||||
logging.getLogger('boto3').setLevel(logging.WARNING)
|
||||
logging.getLogger('botocore').setLevel(logging.WARNING)
|
||||
logging.getLogger('nose').setLevel(logging.WARNING)
|
||||
|
||||
|
||||
class AwsUtils:
|
||||
@@ -63,28 +64,3 @@ class AwsUtils:
|
||||
clears stored session
|
||||
"""
|
||||
self._assume_session = None
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def aws_utils(
|
||||
request: pytest.fixture,
|
||||
assume_role_arn: str,
|
||||
session_name: str,
|
||||
region_name: str):
|
||||
"""
|
||||
Fixture for AWS util functions
|
||||
:param request: _pytest.fixtures.SubRequest class that handles getting
|
||||
a pytest fixture from a pytest function/fixture.
|
||||
:param assume_role_arn: Role used to fetch temporary aws credentials, configure service clients with obtained credentials.
|
||||
:param session_name: Session name to set.
|
||||
:param region_name: AWS account region to set for session.
|
||||
:return AWSUtils class object.
|
||||
"""
|
||||
aws_utils_obj = AwsUtils(assume_role_arn, session_name, region_name)
|
||||
|
||||
def teardown():
|
||||
aws_utils_obj.destroy()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return aws_utils_obj
|
||||
|
||||
Reference in New Issue
Block a user