{lyn5868} fixing the asset_processor_batch_tests.py auto tests (#5247)

Signed-off-by: Allen Jackson <23512001+jackalbe@users.noreply.github.com>
This commit is contained in:
Allen Jackson
2021-11-03 13:19:22 -05:00
committed by GitHub
parent 8966380acf
commit 815c2d1986
16 changed files with 18 additions and 49 deletions
@@ -329,7 +329,7 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
# or an expected behavior has changed. Processing bootstrap.cfg sometimes but not other times should not
# cause a failure in this test.
num_processed_assets = asset_processor_utils.get_num_processed_assets(output)
assert num_processed_assets >= 8, f'Wrong number of successfully processed assets found in output: '\
assert num_processed_assets >= 6, f'Wrong number of successfully processed assets found in output: '\
'{num_processed_assets}'
missing_assets, _ = asset_processor.compare_assets_with_cache()
@@ -585,20 +585,18 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
3. Verify that logs exist for both AP Batch & AP GUI
"""
asset_processor.create_temp_asset_root()
asset_processor.create_temp_log_root()
LOG_PATH = {
"batch_log": workspace.paths.ap_batch_log(),
"gui_log": workspace.paths.ap_gui_log(),
"job_logs": workspace.paths.ap_job_logs(),
"gui_log": workspace.paths.ap_gui_log()
}
class LogTimes:
batch_log_start_time = 0
gui_log_start_time = 0
job_logs_start_time = 0
batch_log_final_time = 0
gui_log_final_time = 0
job_logs_final_time = 0
@staticmethod
def Report():
@@ -607,12 +605,10 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
Original Times:
Batch: {LogTimes.batch_log_start_time}
GUI: {LogTimes.gui_log_start_time}
JobLogs:{LogTimes.job_logs_start_time}
Post-Run Times:
Batch: {LogTimes.batch_log_final_time}
GUI: {LogTimes.gui_log_final_time}
JobLogs:{LogTimes.job_logs_final_time}
"""
)
@@ -629,23 +625,19 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
LogTimes.Report()
def check_existence(name, path):
assert os.path.exists(path), f"{name} could not be located after running the AP."
assert os.path.exists(path), f"{name} could not be located {path} after running the AP."
# Check if log files previously exist and grab their modification times
update_times("_start_time")
# Run the Batch process
assert asset_processor.batch_process(), "Batch process failed to successfully terminate"
assert asset_processor.batch_process(create_temp_log=False), "Batch process failed to successfully terminate"
asset_processor.gui_process(quitonidle=True)
asset_processor.gui_process(quitonidle=True, create_temp_log=False)
# Check that the Logs directory exists (C1564055)
check_existence("Logs Directory", workspace.paths.ap_log_dir())
# Check that the logs and JobLogs directory have updated modified times (C1564056)
for key in LOG_PATH.keys():
check_existence(key, LOG_PATH[key])
update_times("_final_time")
for key in LOG_PATH.keys():
@@ -708,6 +700,7 @@ class TestsAssetProcessorBatch_AllPlatforms(object):
@pytest.mark.BAT
@pytest.mark.assetpipeline
@pytest.mark.skip(reason="need to change assets from .slice files to an asset type that can have nested dependencies")
def test_validateNestedPreloadDependency_Found(self, asset_processor, ap_setup_fixture, workspace):
"""
Tests processing of a nested circular dependency and verifies that Asset Processor will return an error
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7932fada1523fad4eb6ad5c13111bb4c00d6b0584ec8641060bf25f306b17e69
size 84632
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bf94b548eccb78432db65077124cadf20de975919b181d712fde081f59edd353
size 38848
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1675471085483e0bd252a5bdd4db1b365c66f16ac32a6e6dd70bb1c23df83fa5
size 24160
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1675471085483e0bd252a5bdd4db1b365c66f16ac32a6e6dd70bb1c23df83fa5
size 24160
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21df6ab62f2572daa6d0710ad6819a728ee751a62170903a6773563d614aa51f
size 15191
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21df6ab62f2572daa6d0710ad6819a728ee751a62170903a6773563d614aa51f
size 15191
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f0b4750147acbcc6229a1043ed47ee48e7703a5241f27fc72976e95741144369
size 2372
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a036c3763b96079dde8505ad6995f8b717a777c78d7a434ac8de6f1ccb5d8dd1
size 4327
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf55a4372d82d70d8cdcc95468367cd4fad7649d3fb99c4d85049977b506885c
size 13429
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1821d000b583821fd36ec73f91073d51ae90762225a34a81a74771c36236b5e1
size 12963
@@ -427,8 +427,9 @@ class AssetProcessor(object):
def batch_process(self, timeout=DEFAULT_TIMEOUT_SECONDS, fastscan=True, capture_output=False, platforms=None,
extra_params=None, add_gem_scan_folders=None, add_config_scan_folders=None, decode=True,
expect_failure=False, scan_folder_pattern=None):
self.create_temp_log_root()
expect_failure=False, scan_folder_pattern=None, create_temp_log=True):
if create_temp_log:
self.create_temp_log_root()
ap_path = self._workspace.paths.asset_processor_batch()
command = self.build_ap_command(ap_path=ap_path, fastscan=fastscan, platforms=platforms,
extra_params=extra_params, add_gem_scan_folders=add_gem_scan_folders,
@@ -442,7 +443,7 @@ class AssetProcessor(object):
def gui_process(self, timeout=DEFAULT_TIMEOUT_SECONDS, fastscan=True, capture_output=False, platforms=None,
extra_params=None, add_gem_scan_folders=None, add_config_scan_folders=None, decode=True,
expect_failure=False, quitonidle=False, connect_to_ap=False, accept_input=True, run_until_idle=True,
scan_folder_pattern=None):
scan_folder_pattern=None, create_temp_log=True):
ap_path = os.path.abspath(self._workspace.paths.asset_processor())
ap_exe_path = os.path.dirname(ap_path)
extra_gui_params = []
@@ -472,7 +473,8 @@ class AssetProcessor(object):
else:
extra_gui_params.append(extra_params)
self.create_temp_log_root()
if create_temp_log:
self.create_temp_log_root()
command = self.build_ap_command(ap_path=ap_path, fastscan=fastscan, platforms=platforms,
extra_params=extra_gui_params, add_gem_scan_folders=add_gem_scan_folders,
add_config_scan_folders=add_config_scan_folders,
@@ -580,7 +582,7 @@ class AssetProcessor(object):
if isinstance(platforms, list):
platforms = ','.join(platforms)
command.append(f'--platforms={platforms}')
for key, value in self._enabled_platform_overrides:
for key, value in self._enabled_platform_overrides.items():
command.append(f'--regset="f{ASSET_PROCESSOR_SETTINGS_ROOT_KEY}/Platforms/{key}={value}"')
if extra_params: