Merge branch 'main' into LoadPipelineFromGitHub

This commit is contained in:
Brian Herrera
2021-03-26 17:05:57 -07:00
765 changed files with 11513 additions and 20246 deletions
@@ -30,6 +30,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
ly_add_pytest(
NAME AutomatedTesting::PhysicsTests_Sandbox
@@ -42,6 +44,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Physics
)
endif()
@@ -49,7 +53,7 @@ endif()
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
ly_add_pytest(
NAME AutomatedTesting::ScriptCanvasTests
TEST_SUITE main
TEST_SUITE periodic
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Active.py
TIMEOUT 3600
@@ -58,6 +62,20 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
ScriptCanvas
)
ly_add_pytest(
NAME AutomatedTesting::ScriptCanvasTests_Sandbox
TEST_SUITE sandbox
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Sandbox.py
TIMEOUT 3600
RUNTIME_DEPENDENCIES
Legacy::Editor
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
)
endif()
@@ -74,6 +92,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
WhiteBox
)
endif()
@@ -108,7 +128,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS)
AZ::AssetProcessor
AutomatedTesting.Assets
Gem::EditorPythonBindings.Editor
COMPONENT TestTools
COMPONENT TestTools
)
endif()
@@ -136,7 +156,6 @@ include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake)
if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED)
## DynVeg ##
ly_add_pytest(
NAME DynamicVegetationTests_Main_NoGPU
TEST_SERIAL
@@ -150,6 +169,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
AutomatedTesting.GameLauncher
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
ly_add_pytest(
@@ -165,6 +186,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
AutomatedTesting.GameLauncher
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
ly_add_pytest(
@@ -179,10 +202,11 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
Legacy::Editor
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
## LandscapeCanvas ##
ly_add_pytest(
NAME LandscapeCanvasTests_Main
TEST_SERIAL
@@ -194,6 +218,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
Legacy::Editor
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
## GradientSignal ##
@@ -209,6 +235,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
Legacy::Editor
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
ly_add_pytest(
@@ -222,6 +250,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
Legacy::Editor
AutomatedTesting.Assets
Legacy::CryRenderNULL
COMPONENT
LargeWorlds
)
endif()
@@ -239,6 +269,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_
Legacy::CryRenderNULL
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Editor
)
endif()
@@ -24,7 +24,7 @@ from . import ap_setup_fixture as ap_setup_fixture
def ap_all_platforms_setup_fixture(request, workspace, ap_setup_fixture) -> Dict[str, str]:
dev_dir = os.path.join(workspace.paths.dev())
cache_dir = os.path.join(dev_dir, "Cache")
cache_dir = workspace.paths.cache()
# add some useful locations
resources = ap_setup_fixture
@@ -33,11 +33,11 @@ def ap_all_platforms_setup_fixture(request, workspace, ap_setup_fixture) -> Dict
resources["platform_cache"] = os.path.join(workspace.paths.platform_cache(), workspace.project.lower())
# Specific platform cache locations
resources["pc_cache_location"] = os.path.join(cache_dir, workspace.project, "pc")
resources["es3_cache_location"] = os.path.join(cache_dir, workspace.project, "es3")
resources["ios_cache_location"] = os.path.join(cache_dir, workspace.project, "ios")
resources["osx_gl_cache_location"] = os.path.join(cache_dir, workspace.project, "osx_gl")
resources["provo_cache_location"] = os.path.join(cache_dir, workspace.project, "provo")
resources["pc_cache_location"] = os.path.join(cache_dir, "pc")
resources["es3_cache_location"] = os.path.join(cache_dir, "es3")
resources["ios_cache_location"] = os.path.join(cache_dir, "ios")
resources["osx_gl_cache_location"] = os.path.join(cache_dir, "osx_gl")
resources["provo_cache_location"] = os.path.join(cache_dir, "provo")
resources["all_platforms"] = ["pc", "es3", "ios", "osx_gl", "provo"]
return resources
@@ -52,7 +52,7 @@ def ap_external_project_setup_fixture(request, workspace) -> Dict:
paths = mock()
paths.asset_processor = lambda: resources["ap_path"]
paths.asset_processor_batch = lambda: resources["ap_batch_path"]
paths.asset_processor_config_file = lambda: os.path.join(resources["project_dir"], "AssetProcessorConfig.ini")
paths.asset_processor_config_file = lambda: os.path.join(resources["project_dir"], "AssetProcessorConfig.setreg")
mock_workspace.paths = paths
resources["external_workspace"] = mock_workspace
@@ -163,7 +163,7 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
assert errors == 0, f"There were {errors} asset processing errors"
# Check that project cache was created (DNE until AP makes it)
project_cache = os.path.join(external_resources["project_dir"], "Cache", external_resources["project_name"])
project_cache = os.path.join(external_resources["project_dir"], "Cache")
assert os.path.exists(project_cache), f"{project_cache} was not created by AP"
# Clean up external project
@@ -273,7 +273,8 @@ class TestsAssetProcessorBatch_Windows(object):
"AssetProcessor: Error: Platform in config file or command line 'notaplatform'" should be present in the logs
"""
asset_processor.create_temp_asset_root()
error_search_terms = "AssetProcessor: Error: Platform in config file or command line 'notaplatform'"
error_search_terms = 'AssetProcessor: Error: The list of enabled platforms in the settings registry does not contain platform ' \
'"notaplatform"'
# Run APBatch expecting it to fail
asset_processor.run_and_check_output(True, error_search_terms, platforms='notaplatform')
@@ -25,7 +25,7 @@ import ly_test_tools.environment.waiter as waiter
import ly_test_tools.environment.file_system as fs
import ly_test_tools.environment.process_utils as process_utils
import ly_test_tools.launchers.launcher_helper as launcher_helper
from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP
from ly_test_tools.lumberyard.asset_processor import ASSET_PROCESSOR_PLATFORM_MAP, ASSET_PROCESSOR_SETTINGS_ROOT_KEY
# Import fixtures
from ..ap_fixtures.asset_processor_fixture import asset_processor as asset_processor
@@ -136,7 +136,7 @@ class TestsAssetProcessorGUI_WindowsAndMac(object):
# Validate that no fatal errors (crashes) are reported within a certain time frame (10 seconds timeout)
# This applies to AP and GameLauncher.exe
time.sleep(CHECK_ALIVE_SECONDS)
launcher_name = f"{workspace.project.title()}Launcher"
launcher_name = f"{workspace.project.title()}.GameLauncher"
# fmt:off
assert process_utils.process_exists(launcher_name, ignore_extensions=True), \
f"{launcher_name} was not live during the check."
@@ -221,23 +221,20 @@ class TestsAssetProcessorGUI_AllPlatforms(object):
assert not test_assets_added_to_cache(), "Test assets are present in cache before adding scan folder"
# Add test assets folder in dev to AP config file (AssetProcessorPlatformConfig.ini) to be scanned
ap_config_file = os.path.join(asset_processor.temp_asset_root(), 'AssetProcessorPlatformConfig.ini')
config = configparser.ConfigParser()
config.read(ap_config_file)
config["ScanFolder C4874115"] = {
"watch": "@ROOT@/C4874115",
"output": "C4874115",
"recursive": "1",
"order": "5000",
}
with open(ap_config_file, "w") as configfile:
config.write(configfile)
# Supply an additional scan folder for the test via the settings registry regset parameters
test_scan_folder_params = []
test_scan_folder_root_key = f"{ASSET_PROCESSOR_SETTINGS_ROOT_KEY}/ScanFolder C4874115"
test_scan_folder_params.append(f'--regset="{test_scan_folder_root_key}/watch=@ROOT@/C4874115"')
test_scan_folder_params.append(f'--regset="{test_scan_folder_root_key}/output=C4874115"')
test_scan_folder_params.append(f'--regset="{test_scan_folder_root_key}/recursive=1"')
test_scan_folder_params.append(f'--regset="{test_scan_folder_root_key}/order=5000"')
# Run AP GUI and read the config file we just modified to pick up our scan folder
# Pass in a pattern so we don't spend time processing unrelated folders
result, _ = asset_processor.gui_process(quitonidle=True, add_config_scan_folders=True,
scan_folder_pattern="*C4874115*")
scan_folder_pattern="*C4874115*",
extra_params=test_scan_folder_params)
assert result, "AP GUI failed"
# Verify test assets processed into cache after adding scan folder
@@ -255,10 +252,9 @@ class TestsAssetProcessorGUI_AllPlatforms(object):
test_ip_address = "1.1.1.1" # an IP address without Asset Processor
asset_processor.create_temp_asset_root()
# Edit remote_ip setting in bootstrap.cfg to an IP address without Asset Processor
workspace.settings.modify_bootstrap_setting("remote_ip", test_ip_address,
bootstrap_path=os.path.join(asset_processor.temp_asset_root(),
'bootstrap.cfg'))
# Set the remote_ip setting through the settings registry to an IP address without Asset Processor
extra_params = []
extra_params.append(f'--regset="/Amazon/AzCore/Bootstrap/remote_ip={test_ip_address}"')
# Run AP Gui to verify that assets process regardless of the new address
result, _ = asset_processor.gui_process(quitonidle=True)
@@ -64,7 +64,7 @@ class TestsMissingDependencies_WindowsAndMac(object):
self._missing_dep_helper = missing_dep_helper
self._asset_processor.create_temp_asset_root()
self._asset_processor.add_source_folder_assets(f"AutomatedTesting\\TestAssets")
missing_dep_helper.asset_db = os.path.join(asset_processor.temp_asset_root(), "Cache", workspace.project,
missing_dep_helper.asset_db = os.path.join(asset_processor.temp_asset_root(), "Cache",
"assetdb.sqlite")
self._asset_processor.add_source_folder_assets(f"{self._workspace.project}\\Slices")
self._asset_processor.add_source_folder_assets(f"{self._workspace.project}\\Materials")
@@ -597,9 +597,9 @@ class TestsFBX_AllPlatforms(object):
# Load the asset database.
db_path = os.path.join(asset_processor.temp_asset_root(), "Cache",
workspace.project, "assetdb.sqlite")
"assetdb.sqlite")
cache_root = os.path.dirname(os.path.join(asset_processor.temp_asset_root(), "Cache",
workspace.project, ASSET_PROCESSOR_PLATFORM_MAP[workspace.asset_processor_platform]))
ASSET_PROCESSOR_PLATFORM_MAP[workspace.asset_processor_platform]))
if blackbox_params.scene_debug_file:
debug_graph_path = os.path.join(asset_processor.project_test_cache_folder(), blackbox_params.scene_debug_file)
@@ -131,8 +131,9 @@ class TestAutomationBase:
crash_info = f.read()
except Exception as ex:
crash_info += f"\n{str(ex)}"
error_str = f"Editor.exe crashed, return code: 0x{return_code:0X}\n\nCrash log:\n{crash_info}"
return_code_str = f"0x{return_code:0X}" if isinstance(return_code, int) else "None"
error_str = f"Editor.exe crashed, return code: {return_code_str}\n\nCrash log:\n{crash_info}"
errors.append(TestRunError("CRASH", error_str))
self.test_times[testcase_name] = time.time() - test_starttime
@@ -19,16 +19,11 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesti
from base import TestAutomationBase
@pytest.mark.SUITE_main
@pytest.mark.SUITE_periodic
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform):
from . import Opening_Closing_Pane as test_module
self._run_test(request, workspace, editor, test_module)
def test_Docking_Pane(self, request, workspace, editor, launcher_platform):
from . import Docking_Pane as test_module
self._run_test(request, workspace, editor, test_module)
@@ -36,4 +31,3 @@ class TestAutomation(TestAutomationBase):
def test_Resizing_Pane(self, request, workspace, editor, launcher_platform):
from . import Resizing_Pane as test_module
self._run_test(request, workspace, editor, test_module)
@@ -0,0 +1,30 @@
"""
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 sys
from ly_test_tools import LAUNCHERS
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
from base import TestAutomationBase
@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
@pytest.mark.parametrize("project", ["AutomatedTesting"])
class TestAutomation(TestAutomationBase):
def test_Opening_Closing_Pane(self, request, workspace, editor, launcher_platform):
from . import Opening_Closing_Pane as test_module
self._run_test(request, workspace, editor, test_module)