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
@@ -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)