Merging latest main
commit
6a643392f0
@ -0,0 +1,6 @@
|
||||
{
|
||||
"AWSResourceMappings": {},
|
||||
"AccountId": "",
|
||||
"Region": "us-west-2",
|
||||
"Version": "1.0.0"
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# AWS Automated Tests
|
||||
# Runs AWS Gems automation tests.
|
||||
################################################################################
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# Enable after installing NodeJS and CDK on jenkins Windows AMI.
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::AWSTests
|
||||
# TEST_SUITE periodic
|
||||
# TEST_SERIAL
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/AWS/${PAL_PLATFORM_NAME}/
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# Legacy::Editor
|
||||
# AZ::AssetProcessor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# AWS
|
||||
#)
|
||||
endif()
|
||||
@ -0,0 +1,155 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import boto3
|
||||
|
||||
import ly_test_tools.environment.process_utils as process_utils
|
||||
from typing import List
|
||||
|
||||
|
||||
class Cdk:
|
||||
"""
|
||||
Cdk class that provides methods to run cdk application commands.
|
||||
Expects system to have NodeJS, AWS CLI and CDK installed globally and have their paths setup as env variables.
|
||||
"""
|
||||
def __init__(self, cdk_path: str, project: str, account_id: str,
|
||||
workspace: pytest.fixture, session: boto3.session.Session):
|
||||
"""
|
||||
:param cdk_path: Path where cdk app.py is stored.
|
||||
:param project: Project name used for cdk project name env variable.
|
||||
:param account_id: AWS account id to use with cdk application.
|
||||
:param workspace: ly_test_tools workspace fixture.
|
||||
"""
|
||||
self._cdk_env = os.environ.copy()
|
||||
self._cdk_env['O3DE_AWS_PROJECT_NAME'] = project
|
||||
self._cdk_env['O3DE_AWS_DEPLOY_REGION'] = session.region_name
|
||||
self._cdk_env['O3DE_AWS_DEPLOY_ACCOUNT'] = account_id
|
||||
self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH']
|
||||
|
||||
credentials = session.get_credentials().get_frozen_credentials()
|
||||
self._cdk_env['AWS_ACCESS_KEY_ID'] = credentials.access_key
|
||||
self._cdk_env['AWS_SECRET_ACCESS_KEY'] = credentials.secret_key
|
||||
self._cdk_env['AWS_SESSION_TOKEN'] = credentials.token
|
||||
self._stacks = []
|
||||
self._cdk_path = cdk_path
|
||||
|
||||
output = process_utils.check_output(
|
||||
'python -m pip install -r requirements.txt',
|
||||
cwd=self._cdk_path,
|
||||
env=self._cdk_env,
|
||||
shell=True)
|
||||
|
||||
def list(self) -> List[str]:
|
||||
"""
|
||||
lists cdk stack names
|
||||
:return List of cdk stack names
|
||||
"""
|
||||
|
||||
if not self._cdk_path:
|
||||
return []
|
||||
|
||||
list_cdk_application_cmd = ['cdk', 'list']
|
||||
output = process_utils.check_output(
|
||||
list_cdk_application_cmd,
|
||||
cwd=self._cdk_path,
|
||||
env=self._cdk_env,
|
||||
shell=True)
|
||||
|
||||
return output.splitlines()
|
||||
|
||||
def synthesize(self) -> None:
|
||||
"""
|
||||
Synthesizes all cdk stacks
|
||||
"""
|
||||
if not self._cdk_path:
|
||||
return
|
||||
|
||||
list_cdk_application_cmd = ['cdk', 'synth']
|
||||
|
||||
process_utils.check_output(
|
||||
list_cdk_application_cmd,
|
||||
cwd=self._cdk_path,
|
||||
env=self._cdk_env,
|
||||
shell=True)
|
||||
|
||||
def deploy(self, context_variable: str = '') -> List[str]:
|
||||
"""
|
||||
Deploys all the CDK stacks.
|
||||
:param context_variable: Context variable for enabling optional features.
|
||||
:return List of deployed stack arns.
|
||||
"""
|
||||
if not self._cdk_path:
|
||||
return []
|
||||
|
||||
deploy_cdk_application_cmd = ['cdk', 'deploy', '--require-approval', 'never']
|
||||
if context_variable:
|
||||
deploy_cdk_application_cmd.extend(['-c', f'{context_variable}'])
|
||||
|
||||
output = process_utils.check_output(
|
||||
deploy_cdk_application_cmd,
|
||||
cwd=self._cdk_path,
|
||||
env=self._cdk_env,
|
||||
shell=True)
|
||||
|
||||
stacks = []
|
||||
for line in output.splitlines():
|
||||
line_sections = line.split('/')
|
||||
assert len(line_sections), 3
|
||||
stacks.append(line.split('/')[-2])
|
||||
|
||||
return stacks
|
||||
|
||||
def destroy(self) -> None:
|
||||
"""
|
||||
Destroys the cdk application.
|
||||
"""
|
||||
destroy_cdk_application_cmd = ['cdk', 'destroy', '-f']
|
||||
process_utils.check_output(
|
||||
destroy_cdk_application_cmd,
|
||||
cwd=self._cdk_path,
|
||||
env=self._cdk_env,
|
||||
shell=True)
|
||||
|
||||
self._stacks = []
|
||||
self._cdk_path = ''
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def cdk(
|
||||
request: pytest.fixture,
|
||||
project: str,
|
||||
feature_name: str,
|
||||
workspace: pytest.fixture,
|
||||
aws_utils: pytest.fixture,
|
||||
destroy_stacks_on_teardown: bool = True) -> Cdk:
|
||||
"""
|
||||
Fixture for setting up a Cdk
|
||||
:param request: _pytest.fixtures.SubRequest class that handles getting
|
||||
a pytest fixture from a pytest function/fixture.
|
||||
:param project: Project name used for cdk project name env variable.
|
||||
:param feature_name: Feature gem name to expect cdk folder in.
|
||||
:param workspace: ly_test_tools workspace fixture.
|
||||
:param aws_utils: aws_utils fixture.
|
||||
:param destroy_stacks_on_teardown: option to control calling destroy ot the end of test.
|
||||
:return Cdk class object.
|
||||
"""
|
||||
|
||||
cdk_path = f'{workspace.paths.engine_root()}/Gems/{feature_name}/cdk'
|
||||
cdk_obj = Cdk(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session())
|
||||
|
||||
def teardown():
|
||||
if destroy_stacks_on_teardown:
|
||||
cdk_obj.destroy()
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return cdk_obj
|
||||
@ -0,0 +1,78 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
import pytest
|
||||
import os
|
||||
import logging
|
||||
import ly_test_tools.log.log_monitor
|
||||
|
||||
from AWS.Windows.resource_mappings.resource_mappings import resource_mappings
|
||||
from AWS.Windows.cdk.cdk import cdk
|
||||
from AWS.common.aws_utils import aws_utils
|
||||
from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor as asset_processor
|
||||
|
||||
AWS_PROJECT_NAME = 'AWS-AutomationTest'
|
||||
AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth'
|
||||
AWS_CLIENT_AUTH_DEFAULT_PROFILE_NAME = 'default'
|
||||
|
||||
GAME_LOG_NAME = 'Game.log'
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@pytest.mark.SUITE_periodic
|
||||
@pytest.mark.usefixtures('automatic_process_killer')
|
||||
@pytest.mark.usefixtures('asset_processor')
|
||||
@pytest.mark.usefixtures('workspace')
|
||||
@pytest.mark.parametrize('project', ['AutomatedTesting'])
|
||||
@pytest.mark.parametrize('level', ['AWS/ClientAuth'])
|
||||
@pytest.mark.usefixtures('cdk')
|
||||
@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME])
|
||||
@pytest.mark.usefixtures('resource_mappings')
|
||||
@pytest.mark.parametrize('resource_mappings_filename', ['aws_resource_mappings.json'])
|
||||
@pytest.mark.usefixtures('aws_utils')
|
||||
@pytest.mark.parametrize('region_name', ['us-west-2'])
|
||||
@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests'])
|
||||
@pytest.mark.parametrize('session_name', ['o3de-Automation-session'])
|
||||
class TestAWSClientAuthAnonymousCredentials(object):
|
||||
"""
|
||||
Test class to verify AWS Cognito Identity pool anonymous authorization.
|
||||
"""
|
||||
|
||||
def test_anonymous_credentials(self,
|
||||
level: str,
|
||||
launcher: pytest.fixture,
|
||||
cdk: pytest.fixture,
|
||||
resource_mappings: pytest.fixture,
|
||||
workspace: pytest.fixture,
|
||||
asset_processor: pytest.fixture
|
||||
):
|
||||
"""
|
||||
Setup: Deploys cdk and updates resource mapping file.
|
||||
Tests: Getting AWS credentials for no signed in user.
|
||||
Verification: Log monitor looks for success credentials log.
|
||||
"""
|
||||
logger.info(f'Cdk stack names:\n{cdk.list()}')
|
||||
stacks = cdk.deploy()
|
||||
resource_mappings.populate_output_keys(stacks)
|
||||
asset_processor.start()
|
||||
asset_processor.wait_for_idle()
|
||||
|
||||
file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME)
|
||||
log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor)
|
||||
|
||||
launcher.args = ['+LoadLevel', level]
|
||||
|
||||
with launcher.start(launch_ap=False):
|
||||
result = log_monitor.monitor_log_for_lines(
|
||||
expected_lines=['(Script) - Success anonymous credentials'],
|
||||
unexpected_lines=['(Script) - Fail anonymous credentials'],
|
||||
halt_on_unexpected=True,
|
||||
)
|
||||
assert result, 'Anonymous credentials fetched successfully.'
|
||||
@ -0,0 +1,10 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
@ -0,0 +1,137 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import json
|
||||
|
||||
AWS_RESOURCE_MAPPINGS_KEY = 'AWSResourceMappings'
|
||||
AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY = 'AccountId'
|
||||
AWS_RESOURCE_MAPPINGS_REGION_KEY = 'Region'
|
||||
|
||||
|
||||
class ResourceMappings:
|
||||
"""
|
||||
ResourceMappings class that handles writing Cloud formation outputs to resource mappings json file in a project.
|
||||
"""
|
||||
|
||||
def __init__(self, file_path: str, region: str, feature_name: str, account_id: str, workspace: pytest.fixture,
|
||||
cloud_formation_client):
|
||||
"""
|
||||
:param file_path: Path for the resource mapping file.
|
||||
:param region: Region value for the resource mapping file.
|
||||
:param feature_name: Feature gem name to use to append name to mappings key.
|
||||
:param account_id: AWS account id value for the resource mapping file.
|
||||
:param workspace: ly_test_tools workspace fixture.
|
||||
:param cloud_formation_client: AWS cloud formation client.
|
||||
"""
|
||||
self._cdk_env = os.environ.copy()
|
||||
self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH']
|
||||
self._resource_mapping_file_path = file_path
|
||||
self._region = region
|
||||
self._feature_name = feature_name
|
||||
self._account_id = account_id
|
||||
|
||||
assert os.path.exists(self._resource_mapping_file_path), \
|
||||
f'Invalid resource mapping file path {self._resource_mapping_file_path}'
|
||||
self._client = cloud_formation_client
|
||||
|
||||
def populate_output_keys(self, stacks=[]) -> None:
|
||||
"""
|
||||
Calls describe stacks on cloud formation service and persists outputs to resource mappings file.
|
||||
:param stacks List of stack arns to describe and populate resource mappings with.
|
||||
"""
|
||||
for stack_name in stacks:
|
||||
response = self._client.describe_stacks(
|
||||
StackName=stack_name
|
||||
)
|
||||
stacks = response.get('Stacks', [])
|
||||
assert len(stacks) == 1, f'{stack_name} is invalid.'
|
||||
|
||||
self.__write_resource_mappings(stacks[0].get('Outputs', []))
|
||||
|
||||
def __write_resource_mappings(self, outputs, append_feature_name = True) -> None:
|
||||
with open(self._resource_mapping_file_path) as file_content:
|
||||
resource_mappings = json.load(file_content)
|
||||
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY] = self._account_id
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = self._region
|
||||
|
||||
# Append new mappings.
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = resource_mappings.get(AWS_RESOURCE_MAPPINGS_KEY, {})
|
||||
|
||||
for output in outputs:
|
||||
if append_feature_name:
|
||||
resource_key = f'{self._feature_name}.{output.get("OutputKey", "InvalidKey")}'
|
||||
else:
|
||||
resource_key = output.get("OutputKey", "InvalidKey")
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key] = resource_mappings[
|
||||
AWS_RESOURCE_MAPPINGS_KEY].get(resource_key, {})
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Type'] = 'AutomationTestType'
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID'] = output.get('OutputValue',
|
||||
'InvalidId')
|
||||
|
||||
with open(self._resource_mapping_file_path, 'w') as file_content:
|
||||
json.dump(resource_mappings, file_content, indent=4)
|
||||
|
||||
def clear_output_keys(self) -> None:
|
||||
"""
|
||||
Clears values of all resource mapping keys. Sets region to default to us-west-2
|
||||
"""
|
||||
with open(self._resource_mapping_file_path) as file_content:
|
||||
resource_mappings = json.load(file_content)
|
||||
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY] = ''
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = 'us-west-2'
|
||||
|
||||
# Append new mappings.
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = resource_mappings.get(AWS_RESOURCE_MAPPINGS_KEY, {})
|
||||
resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = {}
|
||||
|
||||
with open(self._resource_mapping_file_path, 'w') as file_content:
|
||||
json.dump(resource_mappings, file_content, indent=4)
|
||||
|
||||
self._resource_mapping_file_path = ''
|
||||
self._region = ''
|
||||
self._client = None
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def resource_mappings(
|
||||
request: pytest.fixture,
|
||||
project: str,
|
||||
feature_name: str,
|
||||
resource_mappings_filename: str,
|
||||
workspace: pytest.fixture,
|
||||
aws_utils: pytest.fixture) -> ResourceMappings:
|
||||
"""
|
||||
Fixture for setting up resource mappings file.
|
||||
:param request: _pytest.fixtures.SubRequest class that handles getting
|
||||
a pytest fixture from a pytest function/fixture.
|
||||
:param project: Project to find resource mapping file.
|
||||
:param feature_name: AWS Gem name that is prepended to resource mapping keys.
|
||||
:param resource_mappings_filename: Name of resource mapping file.
|
||||
:param workspace: ly_test_tools workspace fixture.
|
||||
:param aws_utils: AWS utils fixture.
|
||||
:return: ResourceMappings class object.
|
||||
"""
|
||||
|
||||
path = f'{workspace.paths.engine_root()}\\{project}\\Config\\{resource_mappings_filename}'
|
||||
resource_mappings_obj = ResourceMappings(path, aws_utils.assume_session().region_name, feature_name,
|
||||
aws_utils.assume_account_id(), workspace,
|
||||
aws_utils.client('cloudformation'))
|
||||
|
||||
def teardown():
|
||||
resource_mappings_obj.clear_output_keys()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return resource_mappings_obj
|
||||
@ -0,0 +1,11 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
@ -0,0 +1,82 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
import boto3
|
||||
import pytest
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AwsUtils:
|
||||
|
||||
def __init__(self, arn: str, session_name: str, region_name: str):
|
||||
local_session = boto3.Session(profile_name='default')
|
||||
local_sts_client = local_session.client('sts')
|
||||
self._local_account_id = local_sts_client.get_caller_identity()["Account"]
|
||||
logger.info(f'Local Account Id: {self._local_account_id}')
|
||||
|
||||
response = local_sts_client.assume_role(RoleArn=arn, RoleSessionName=session_name)
|
||||
|
||||
self._assume_session = boto3.Session(aws_access_key_id=response['Credentials']['AccessKeyId'],
|
||||
aws_secret_access_key=response['Credentials']['SecretAccessKey'],
|
||||
aws_session_token=response['Credentials']['SessionToken'],
|
||||
region_name=region_name)
|
||||
|
||||
assume_sts_client = self._assume_session.client('sts')
|
||||
assume_account_id = assume_sts_client.get_caller_identity()["Account"]
|
||||
logger.info(f'Assume Account Id: {assume_account_id}')
|
||||
self._assume_account_id = assume_account_id
|
||||
|
||||
def client(self, service: str):
|
||||
"""
|
||||
Get the client for a specific AWS service from configured session
|
||||
:return: Client for the AWS service.
|
||||
"""
|
||||
return self._assume_session.client(service)
|
||||
|
||||
def assume_session(self):
|
||||
return self._assume_session
|
||||
|
||||
def local_account_id(self):
|
||||
return self._local_account_id
|
||||
|
||||
def assume_account_id(self):
|
||||
return self._assume_account_id
|
||||
|
||||
def destroy(self) -> None:
|
||||
"""
|
||||
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 setting up a Cdk
|
||||
: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
|
||||
@ -0,0 +1,25 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::BlastTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL TRUE
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT Blast
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,26 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorPythonBindings
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,26 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::NvClothTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
NvCloth
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,27 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PythonAssetBuilder
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
Gem::EditorPythonBindings.Editor
|
||||
Gem::PythonAssetBuilder.Editor
|
||||
COMPONENT TestTools
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,26 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::WhiteBoxTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
WhiteBox
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,26 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::EditorTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Editor
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,186 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED)
|
||||
|
||||
## DynVeg ##
|
||||
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::DynamicVegetationTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.GameLauncher
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationTests_Sandbox
|
||||
TEST_SERIAL
|
||||
TEST_SUITE sandbox
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_sandbox"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_filter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_modifier"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_regression"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_area"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_misc"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg
|
||||
PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
## LandscapeCanvas ##
|
||||
# Temporarily moving all tests to periodic suite - SPEC-6553
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::LandscapeCanvasTests_Main
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE main
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas
|
||||
# PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark"
|
||||
# TIMEOUT 1500
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# Legacy::Editor
|
||||
# AutomatedTesting.Assets
|
||||
# COMPONENT
|
||||
# LargeWorlds
|
||||
#)
|
||||
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::LandscapeCanvasTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas
|
||||
PYTEST_MARKS "SUITE_periodic"
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
## GradientSignal ##
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::GradientSignalTests_Periodic
|
||||
TEST_SERIAL
|
||||
TEST_SUITE periodic
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
Legacy::Editor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
LargeWorlds
|
||||
)
|
||||
|
||||
endif()
|
||||
@ -0,0 +1,52 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Main
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Periodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PhysicsTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Physics
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,25 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
## Prefab ##
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::PrefabTests
|
||||
TEST_SUITE main
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,37 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests_Perodic
|
||||
TEST_SUITE periodic
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
ScriptCanvas
|
||||
)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::ScriptCanvasTests_Sandbox
|
||||
TEST_SUITE sandbox
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
Legacy::Editor
|
||||
AZ::AssetProcessor
|
||||
AutomatedTesting.Assets
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,161 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
|
||||
class Tests:
|
||||
test_panes_visible = "All the test panes are opened"
|
||||
close_pane_1 = "Test pane 1 is closed"
|
||||
resize_pane_3 = "Test pane 3 resized successfully"
|
||||
location_changed = "Location of test pane 2 changed successfully"
|
||||
visiblity_retained = "Test pane retained its visiblity on Editor restart"
|
||||
location_retained = "Test pane retained its location on Editor restart"
|
||||
size_retained = "Test pane retained its size on Editor restart"
|
||||
|
||||
|
||||
def Pane_PropertiesChanged_RetainsOnRestart():
|
||||
"""
|
||||
Summary:
|
||||
The Script Canvas window is opened to verify if Script canvas panes can retain its visibility, size and location
|
||||
upon Editor restart.
|
||||
|
||||
Expected Behavior:
|
||||
The ScriptCanvas pane retain it's visiblity, size and location upon Editor restart.
|
||||
|
||||
Test Steps:
|
||||
1) Open Script Canvas window (Tools > Script Canvas)
|
||||
2) Make sure test panes are open and visible
|
||||
3) Close test pane 1
|
||||
4) Change dock location of test pane 2
|
||||
5) Resize test pane 3
|
||||
6) Restart Editor
|
||||
7) Verify if test pane 1 retain its visiblity
|
||||
8) Verify if location of test pane 2 is retained
|
||||
9) Verify if size of test pane 3 is retained
|
||||
10) Restore default layout and close SC window
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Open 3D Engine Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
# Helper imports
|
||||
from utils import Report
|
||||
from utils import TestHelper as helper
|
||||
import pyside_utils
|
||||
|
||||
# Lumberyard Imports
|
||||
import azlmbr.legacy.general as general
|
||||
|
||||
# Pyside imports
|
||||
from PySide2 import QtCore, QtWidgets
|
||||
from PySide2.QtCore import Qt
|
||||
|
||||
# Constants
|
||||
TEST_CONDITION = sys.argv[1]
|
||||
TEST_PANE_1 = "NodePalette" # pane used to test visibility
|
||||
TEST_PANE_2 = "VariableManager" # pane used to test location
|
||||
TEST_PANE_3 = "NodeInspector" # pane used to test size
|
||||
SCALE_INT = 10 # Random resize scale integer
|
||||
DOCKAREA = Qt.TopDockWidgetArea # Preferred top area since no widget is docked on top
|
||||
|
||||
def click_menu_option(window, option_text):
|
||||
action = pyside_utils.find_child_by_pattern(window, {"text": option_text, "type": QtWidgets.QAction})
|
||||
action.trigger()
|
||||
|
||||
def find_pane(window, pane_name):
|
||||
return window.findChild(QtWidgets.QDockWidget, pane_name)
|
||||
|
||||
# Test starts here
|
||||
general.idle_enable(True)
|
||||
|
||||
# 1) Open Script Canvas window (Tools > Script Canvas)
|
||||
general.open_pane("Script Canvas")
|
||||
helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0)
|
||||
|
||||
if TEST_CONDITION == "before_restart":
|
||||
# 2) Make sure test panes are open and visible
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
click_menu_option(sc, "Restore Default Layout")
|
||||
test_pane_1 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_1)
|
||||
test_pane_2 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_2)
|
||||
test_pane_3 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_3)
|
||||
|
||||
result = test_pane_1.isVisible() and test_pane_2.isVisible() and test_pane_3.isVisible()
|
||||
Report.info(f"{Tests.test_panes_visible}: {result}")
|
||||
|
||||
# 3) Close test pane
|
||||
test_pane_1.close()
|
||||
Report.info(f"{Tests.close_pane_1}: {not test_pane_1.isVisible()}")
|
||||
|
||||
# 4) Change dock location of test pane 2
|
||||
sc_main = sc.findChild(QtWidgets.QMainWindow)
|
||||
sc_main.addDockWidget(DOCKAREA, find_pane(sc_main, TEST_PANE_2), QtCore.Qt.Vertical)
|
||||
Report.info(f"{Tests.location_changed}: {sc_main.dockWidgetArea(find_pane(sc_main, TEST_PANE_2)) == DOCKAREA}")
|
||||
|
||||
# 5) Resize test pane 3
|
||||
initial_size = test_pane_3.frameSize()
|
||||
test_pane_3.resize(initial_size.width() + SCALE_INT, initial_size.height() + SCALE_INT)
|
||||
new_size = test_pane_3.frameSize()
|
||||
resize_success = (
|
||||
abs(initial_size.width() - new_size.width()) == abs(initial_size.height() - new_size.height()) == SCALE_INT
|
||||
)
|
||||
Report.info(f"{Tests.resize_pane_3}: {resize_success}")
|
||||
|
||||
if TEST_CONDITION == "after_restart":
|
||||
try:
|
||||
# 6) Restart Editor
|
||||
# Restart is not possible through script and hence it is done by running the same file as 2 tests with a
|
||||
# condition as before_test and after_test
|
||||
|
||||
# 7) Verify if test pane 1 retain its visiblity
|
||||
# This pane closed before restart and expected that pane should not be visible.
|
||||
editor_window = pyside_utils.get_editor_main_window()
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
Report.info(f"{Tests.visiblity_retained}: {not find_pane(sc, TEST_PANE_1).isVisible()}")
|
||||
|
||||
# 8) Verify if location of test pane 2 is retained
|
||||
# This pane was set at DOCKAREA lcoation before restart
|
||||
sc_main = sc.findChild(QtWidgets.QMainWindow)
|
||||
Report.info(
|
||||
f"{Tests.location_retained}: {sc_main.dockWidgetArea(find_pane(sc_main, TEST_PANE_2)) == DOCKAREA}"
|
||||
)
|
||||
|
||||
# 9) Verify if size of test pane 3 is retained
|
||||
# Verifying if size retained by checking current size not matching with default size
|
||||
test_pane_3 = find_pane(sc, TEST_PANE_3)
|
||||
retained_size = test_pane_3.frameSize()
|
||||
click_menu_option(sc, "Restore Default Layout")
|
||||
actual_size = test_pane_3.frameSize()
|
||||
Report.info(f"{Tests.size_retained}: {retained_size != actual_size}")
|
||||
|
||||
finally:
|
||||
# 10) Restore default layout and close SC window
|
||||
general.open_pane("Script Canvas")
|
||||
helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0)
|
||||
sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas")
|
||||
click_menu_option(sc, "Restore Default Layout")
|
||||
sc.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(Pane_PropertiesChanged_RetainsOnRestart)
|
||||
@ -0,0 +1,27 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
ly_add_pytest(
|
||||
NAME AutomatedTesting::SmokeTest
|
||||
TEST_SUITE smoke
|
||||
TEST_SERIAL
|
||||
PATH ${CMAKE_CURRENT_LIST_DIR}
|
||||
TIMEOUT 1500
|
||||
RUNTIME_DEPENDENCIES
|
||||
AZ::AssetProcessor
|
||||
AZ::PythonBindingsExample
|
||||
Legacy::Editor
|
||||
AutomatedTesting.GameLauncher
|
||||
AutomatedTesting.Assets
|
||||
COMPONENT
|
||||
Smoke
|
||||
)
|
||||
endif()
|
||||
@ -0,0 +1,147 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
Test Case Title: Create Test for UI apps- Editor
|
||||
"""
|
||||
|
||||
|
||||
class Tests():
|
||||
level_created = ("Level created", "Failed to create level")
|
||||
entity_found = ("New Entity created in level", "Failed to create New Entity in level")
|
||||
mesh_added = ("Mesh Component added", "Failed to add Mesh Component")
|
||||
enter_game_mode = ("Game Mode successfully entered", "Failed to enter in Game Mode")
|
||||
exit_game_mode = ("Game Mode successfully exited", "Failed to exit in Game Mode")
|
||||
level_opened = ("Level opened successfully", "Failed to open level")
|
||||
level_exported = ("Level exported successfully", "Failed to export level")
|
||||
mesh_removed = ("Mesh Component removed", "Failed to remove Mesh Component")
|
||||
entity_deleted = ("Entity deleted", "Failed to delete Entity")
|
||||
level_edits_present = ("Level edits persist after saving", "Failed to save level edits after saving")
|
||||
|
||||
|
||||
def Editor_NewExistingLevels_Works():
|
||||
"""
|
||||
Summary: Perform the below operations on Editor
|
||||
|
||||
1) Launch & Close editor
|
||||
2) Create new level
|
||||
3) Saving and loading levels
|
||||
4) Level edits persist after saving
|
||||
5) Export Level
|
||||
6) Can switch to play mode (ctrl+g) and exit that
|
||||
7) Run editor python bindings test
|
||||
8) Create an Entity
|
||||
9) Delete an Entity
|
||||
10) Add a component to an Entity
|
||||
|
||||
Expected Behavior:
|
||||
All operations succeed and do not cause a crash
|
||||
|
||||
Test Steps:
|
||||
1) Launch editor and Create a new level
|
||||
2) Create a new entity
|
||||
3) Add Mesh component
|
||||
4) Verify enter/exit game mode
|
||||
5) Save, Load and Export level
|
||||
6) Remove Mesh component
|
||||
7) Delete entity
|
||||
8) Open an existing level
|
||||
9) Create a new entity in an existing level
|
||||
10) Save, Load and Export an existing level and close editor
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Lumberyard Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
|
||||
import os
|
||||
import editor_python_test_tools.hydra_editor_utils as hydra
|
||||
from editor_python_test_tools.utils import TestHelper as helper
|
||||
from editor_python_test_tools.utils import Report
|
||||
import azlmbr.bus as bus
|
||||
import azlmbr.editor as editor
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.math as math
|
||||
|
||||
# 1) Launch editor and Create a new level
|
||||
helper.init_idle()
|
||||
test_level_name = "temp_level"
|
||||
general.create_level_no_prompt(test_level_name, 128, 1, 128, False)
|
||||
helper.wait_for_condition(lambda: general.get_current_level_name() == test_level_name, 2.0)
|
||||
Report.result(Tests.level_created, general.get_current_level_name() == test_level_name)
|
||||
|
||||
# 2) Create a new entity
|
||||
entity_position = math.Vector3(200.0, 200.0, 38.0)
|
||||
new_entity = hydra.Entity("Entity1")
|
||||
new_entity.create_entity(entity_position, [])
|
||||
test_entity = hydra.find_entity_by_name("Entity1")
|
||||
Report.result(Tests.entity_found, test_entity.IsValid())
|
||||
|
||||
# 3) Add Mesh component
|
||||
new_entity.add_component("Mesh")
|
||||
Report.result(Tests.mesh_added, hydra.has_components(new_entity.id, ["Mesh"]))
|
||||
|
||||
# 4) Verify enter/exit game mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
# 5) Save, Load and Export level
|
||||
# Save Level
|
||||
general.save_level()
|
||||
# Open Level
|
||||
general.open_level(test_level_name)
|
||||
Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name)
|
||||
# Export Level
|
||||
general.export_to_engine()
|
||||
level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak")
|
||||
Report.result(Tests.level_exported, os.path.exists(level_pak_file))
|
||||
|
||||
# 6) Remove Mesh component
|
||||
new_entity.remove_component("Mesh")
|
||||
Report.result(Tests.mesh_removed, not hydra.has_components(new_entity.id, ["Mesh"]))
|
||||
|
||||
# 7) Delete entity
|
||||
editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", new_entity.id)
|
||||
test_entity = hydra.find_entity_by_name("Entity1")
|
||||
Report.result(Tests.entity_deleted, len(test_entity) == 0)
|
||||
|
||||
# 8) Open an existing level
|
||||
general.open_level(test_level_name)
|
||||
Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name)
|
||||
|
||||
# 9) Create a new entity in an existing level
|
||||
entity_position = math.Vector3(200.0, 200.0, 38.0)
|
||||
new_entity_2 = hydra.Entity("Entity2")
|
||||
new_entity_2.create_entity(entity_position, [])
|
||||
test_entity = hydra.find_entity_by_name("Entity2")
|
||||
Report.result(Tests.entity_found, test_entity.IsValid())
|
||||
|
||||
# 10) Save, Load and Export an existing level
|
||||
# Save Level
|
||||
general.save_level()
|
||||
# Open Level
|
||||
general.open_level(test_level_name)
|
||||
Report.result(Tests.level_opened, general.get_current_level_name() == test_level_name)
|
||||
entity_id = hydra.find_entity_by_name(new_entity_2.name)
|
||||
Report.result(Tests.level_edits_present, entity_id == new_entity_2.id)
|
||||
# Export Level
|
||||
general.export_to_engine()
|
||||
level_pak_file = os.path.join("AutomatedTesting", "Levels", test_level_name, "level.pak")
|
||||
Report.result(Tests.level_exported, os.path.exists(level_pak_file))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from editor_python_test_tools.utils import Report
|
||||
|
||||
Report.start_test(Editor_NewExistingLevels_Works)
|
||||
@ -0,0 +1,10 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
@ -0,0 +1,33 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - AssetBuilder
|
||||
Launch AssetBuilder and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolAssetBuilderWorks(object):
|
||||
@pytest.mark.xfail(reason="Ignoring failure temporarily - SPEC-6905")
|
||||
def test_CLITool_AssetBuilder_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "AssetBuilder")
|
||||
help_message = "AssetBuilder is part of the Asset Processor"
|
||||
# Launch AssetBuilder
|
||||
output = subprocess.run([file_path, "-help"], capture_output=True, timeout=10)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 0
|
||||
), f"Error occurred while launching {file_path}: {output.stderr}"
|
||||
# Verify help message
|
||||
assert help_message in str(output.stdout), f"Help Message: {help_message} is not present"
|
||||
@ -0,0 +1,32 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - AssetBundlerBatch
|
||||
Launch AssetBundlerBatch and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolAssetBundlerBatchWorks(object):
|
||||
def test_CLITool_AssetBundlerBatch_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "AssetBundlerBatch")
|
||||
help_message = "Specifies the Seed List file to operate on by path"
|
||||
# Launch AssetBundlerBatch
|
||||
output = subprocess.run([file_path, "--help"], capture_output=True, timeout=10)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 0
|
||||
), f"Error occurred while launching {file_path}: {output.stderr}"
|
||||
# Verify help message
|
||||
assert help_message in str(output.stdout), f"Help Message: {help_message} is not present"
|
||||
@ -0,0 +1,26 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - AssetProcessorBatch
|
||||
Launch AssetProcessorBatch and Shutdown AssetProcessorBatch without any crash
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestsCLIToolAssetProcessorBatchWorks(object):
|
||||
def test_CLITool_AssetProcessorBatch_Works(self, workspace):
|
||||
"""
|
||||
Test Launching AssetProcessorBatch and verifies that is shuts down without issue
|
||||
"""
|
||||
workspace.asset_processor.batch_process()
|
||||
@ -0,0 +1,34 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - AzTestRunner
|
||||
Launch AzTestRunner and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolAzTestRunnerWorks(object):
|
||||
def test_CLITool_AzTestRunner_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "AzTestRunner")
|
||||
help_message = "OKAY Symbol found: AzRunUnitTests"
|
||||
# Launch AzTestRunner
|
||||
output = subprocess.run(
|
||||
[file_path, "AzTestRunner.Tests", "AzRunUnitTests", "--gtest_list_tests"], capture_output=True, timeout=10
|
||||
)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 0
|
||||
), f"Error occurred while launching {file_path}: {output.stderr}"
|
||||
# Verify help message
|
||||
assert help_message in str(output.stdout), f"Help Message: {help_message} is not present"
|
||||
@ -0,0 +1,32 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - PythonBindingsExample
|
||||
Launch PythonBindingsExample and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolPythonBindingsExampleWorks(object):
|
||||
def test_CLITool_PythonBindingsExample_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "PythonBindingsExample")
|
||||
help_message = "--help Prints the help text"
|
||||
# Launch PythonBindingsExample
|
||||
output = subprocess.run([file_path, "-help"], capture_output=True, timeout=10)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 1
|
||||
), f"Error occurred while launching {file_path}: {output.stderr}"
|
||||
# Verify help message
|
||||
assert help_message in str(output.stdout), f"Help Message: {help_message} is not present"
|
||||
@ -0,0 +1,32 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
CLI tool - SerializeContextTools
|
||||
Launch SerializeContextTools and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestCLIToolSerializeContextToolsWorks(object):
|
||||
def test_CLITool_SerializeContextTools_Works(self, build_directory):
|
||||
file_path = os.path.join(build_directory, "SerializeContextTools")
|
||||
help_message = "Converts a file with an ObjectStream to the new JSON"
|
||||
# Launch SerializeContextTools
|
||||
output = subprocess.run([file_path, "-help"], capture_output=True, timeout=10)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 0
|
||||
), f"Error occurred while launching {file_path}: {output.stderr}"
|
||||
# Verify help message
|
||||
assert help_message in str(output.stdout), f"Help Message: {help_message} is not present"
|
||||
@ -0,0 +1,32 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
import os
|
||||
from automatedtesting_shared.base import TestAutomationBase
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
|
||||
|
||||
@pytest.mark.SUITE_smoke
|
||||
@pytest.mark.parametrize("launcher_platform", ["windows_editor"])
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.parametrize("level", ["temp_level"])
|
||||
class TestAutomation(TestAutomationBase):
|
||||
def test_Editor_NewExistingLevels_Works(self, request, workspace, editor, level, project, launcher_platform):
|
||||
def teardown():
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True)
|
||||
|
||||
from . import Editor_NewExistingLevels_Works as test_module
|
||||
|
||||
self._run_test(request, workspace, editor, test_module)
|
||||
@ -0,0 +1,44 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
Static tool scripts
|
||||
Launch Static tool and Verify the help message
|
||||
"""
|
||||
|
||||
import os
|
||||
import pytest
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def verify_help_message(static_tool):
|
||||
help_message = ["--help", "show this help message and exit"]
|
||||
output = subprocess.run([sys.executable, static_tool, "-h"], capture_output=True)
|
||||
assert (
|
||||
len(output.stderr) == 0 and output.returncode == 0
|
||||
), f"Error occurred while launching {static_tool}: {output.stderr}"
|
||||
# verify help message
|
||||
for message in help_message:
|
||||
assert message in str(output.stdout), f"Help Message: {message} is not present"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestStaticToolsGenPakShadersWorks(object):
|
||||
def test_StaticTools_GenPakShaders_Works(self, editor):
|
||||
static_tools = [
|
||||
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "gen_shaders.py"),
|
||||
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "get_shader_list.py"),
|
||||
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "pak_shaders.py"),
|
||||
]
|
||||
|
||||
for tool in static_tools:
|
||||
verify_help_message(tool)
|
||||
@ -0,0 +1,39 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
|
||||
UI Apps: AssetProcessor
|
||||
Open AssetProcessor, Wait until AssetProcessor is Idle
|
||||
Close AssetProcessor.
|
||||
"""
|
||||
|
||||
|
||||
import pytest
|
||||
from ly_test_tools.o3de.asset_processor import AssetProcessor
|
||||
|
||||
|
||||
@pytest.mark.parametrize("project", ["AutomatedTesting"])
|
||||
@pytest.mark.SUITE_smoke
|
||||
class TestsUIAppsAssetProcessorCheckIdle(object):
|
||||
@pytest.fixture(autouse=True)
|
||||
def setup_teardown(self, request):
|
||||
self.asset_processor = None
|
||||
|
||||
def teardown():
|
||||
self.asset_processor.stop()
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
def test_UIApps_AssetProcessor_CheckIdle(self, workspace):
|
||||
"""
|
||||
Test Launching AssetProcessorBatch and verifies that is shuts down without issue
|
||||
"""
|
||||
self.asset_processor = AssetProcessor(workspace)
|
||||
self.asset_processor.gui_process()
|
||||
@ -0,0 +1,24 @@
|
||||
#
|
||||
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
# its licensors.
|
||||
#
|
||||
# For complete copyright and license terms please see the LICENSE at the root of this
|
||||
# distribution (the "License"). All use of this software is governed by the License,
|
||||
# or, if provided, by the license below or the license accompanying this file. Do not
|
||||
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
#
|
||||
|
||||
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
|
||||
# Unstable, SPEC-3838 will restore
|
||||
#ly_add_pytest(
|
||||
# NAME AutomatedTesting::asset_load_benchmark_test
|
||||
# TEST_SERIAL
|
||||
# TEST_SUITE benchmark
|
||||
# PATH ${CMAKE_CURRENT_LIST_DIR}/benchmark/asset_load_benchmark_test.py
|
||||
# RUNTIME_DEPENDENCIES
|
||||
# AZ::AssetProcessor
|
||||
# AZ::AssetProcessorBatch
|
||||
# AutomatedTesting.GameLauncher
|
||||
#)
|
||||
endif()
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e1218e785966cba2973af5fcc2adeea81399ef4b9ceee9713e430d14090317bd
|
||||
size 272849
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f0f4d4e0155feaa76c80a14128000a0fd9570ab76e79f4847eaef9006324a4d2
|
||||
size 9084
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
||||
<Environment />
|
||||
@ -0,0 +1 @@
|
||||
<TimeOfDay Time="12"/>
|
||||
@ -0,0 +1,6 @@
|
||||
<download name="ClientAuth" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="ED3" md5="3487525589271b5744ca83734fe3baa6"/>
|
||||
</files>
|
||||
</download>
|
||||
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4900bdf28654e21032e69957f2762fa0a3b93a4b82163267a1f10f19f6d78692
|
||||
size 3795
|
||||
@ -0,0 +1,12 @@
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
0,0,0,0,0,0
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:259892d63259cdc7b0cbee64c979d917820ea2bb402397ef63a3383ea5146b0a
|
||||
size 132288
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:259892d63259cdc7b0cbee64c979d917820ea2bb402397ef63a3383ea5146b0a
|
||||
size 132288
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6f5b950e0dcd47ada8f34dc9f64976ebe156aeedb92d7e6d3467efbeddb3baa2
|
||||
size 17407674
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ae30a71535b7283f4b19a0dee09ad98afc2d23e127d3da53c4da76650c0d9698
|
||||
size 17407642
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5080ffd65c2c76fbd5db96f75496dae7d4992dfc2f6a5e9514345e1d74422143
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e9018429c312bced4975ab9e4d5cd6420a2fc8605b7d0929334dfd7dff50a79b
|
||||
size 272967
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2a53b3ffe745f824431028cc36d1990f55e9303bff99542f8ee3b85cd4417636
|
||||
size 272903
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:35fa1fc96e3092de7200533183d875fe19585ca292e01af24dcc82497c8d400a
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:93c2de86abea5c70845480f09dd86e9aebf2084c8e26444eee846ad9a3b18fe0
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:65464a758912e1dc2cdd39606fe86d05315336635a42a659734b3755f6e4ad4c
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5517e2cd05060859a9e010f9df1f410a7fc9739a8ec6adbc0e214b894a7eef21
|
||||
size 272903
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:55f771fb360a8b7a6d12e9b0e5f8824f9567d1869cb2757b7a3263539d03db1f
|
||||
size 17407561
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b7718b09645345926ac1f59513114f64c6e146a49fac69f2835ce20c831953d7
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3b10f68c7f64dd775e6abc3250c019c1efdf498822b77bd98efb8f8c19513c0e
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:646140ed507ea073e2472196661b204694d686142536e1912b173376324b302a
|
||||
size 274291
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:965f0dd885e93c25183390a87675b5aef1d24d374ededc5e073a98e15318858e
|
||||
size 272903
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e9487342e768620c77288e3b8019ade03cd12eb1c19067b5d6408a185a62203e
|
||||
size 272967
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:54b2dc4c443ea1e9b9aaed9d2aef1227ddeeac7db728b699cacd08811c81db8f
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ae84e1cb4cc4d54cb4cccb361663f8a4bb214e95ad0023cdd068657ef4705e43
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a5c76ddb855bd123944e9582f289298091e6dc9089d877e1175079df72a251d9
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2913bdf321ee6cbe2bf148444554ce0135b41ac5ddac42d62a32d8af4cf7ae1c
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eee27982bfd7ad92814e2287d5fae32f943a470120550e2ac93d2299a4969876
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:52834b00e1392b055902d9bc93c52c145e75f758250049e71dc2d6b40a377279
|
||||
size 272903
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d4bb4e2ab7876994431f3e6e78a004ea5718e057077b37db14ea8a52637338be
|
||||
size 262184
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fb391ba2b3a7631e00b067610f1fa541bfd74d1d64e11aee72741cca5c2b7d90
|
||||
size 17407562
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1802389900e2a041717f05ea9f05ae344edd8ce49b5332204a87d2124459561f
|
||||
size 17407722
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3461c62fd0a988d4f3369116f9447d392cac1f4b1f259dc65aabe2fabbfafb37
|
||||
size 17407722
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fdab340ad6c6dc6c1167e31afa061684be083360fc4108fa9f1fa4b15fe95d8c
|
||||
size 1310792
|
||||
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d7d878cdef5de9038df845b5ef5709cc3afe2a5a3a606f3f5ac4575a733ffc5e
|
||||
size 273095
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue