Merge pull request #5775 from aws-lumberyard-dev/test_artifact_collection

LyTestTools artifact collection
This commit is contained in:
Sean Sweeney
2021-12-03 10:57:50 -08:00
committed by GitHub
4 changed files with 6 additions and 14 deletions
@@ -153,7 +153,6 @@ class Launcher(object):
:return: None
"""
self.workspace.asset_processor.stop()
self.save_project_log_files()
def save_project_log_files(self):
# type: () -> None
@@ -48,6 +48,7 @@ import ly_test_tools.environment.waiter as waiter
import ly_test_tools.environment.process_utils as process_utils
import ly_test_tools.o3de.editor_test
import ly_test_tools.o3de.editor_test_utils as editor_utils
import ly_test_tools._internal.pytest_plugin
from ly_test_tools.o3de.asset_processor import AssetProcessor
from ly_test_tools.launchers.exceptions import WaitTimeoutError
@@ -757,7 +758,7 @@ class EditorTestSuite():
cmdline = [
"--runpythontest", test_filename,
"-logfile", f"@log@/{log_name}",
"-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args
"-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args
editor.args.extend(cmdline)
editor.start(backupFiles = False, launch_ap = False, configure_settings=False)
@@ -823,7 +824,7 @@ class EditorTestSuite():
cmdline = [
"--runpythontest", test_filenames_str,
"-logfile", f"@log@/{log_name}",
"-project-log-path", editor_utils.retrieve_log_path(run_id, workspace)] + test_cmdline_args
"-project-log-path", ly_test_tools._internal.pytest_plugin.output_path] + test_cmdline_args
editor.args.extend(cmdline)
editor.start(backupFiles = False, launch_ap = False, configure_settings=False)
@@ -900,7 +901,6 @@ class EditorTestSuite():
results[test_spec_name] = Result.Timeout.create(timed_out_result.test_spec,
results[test_spec_name].output,
self.timeout_editor_shared_test, result.editor_log)
return results
def _run_single_test(self, request: Request, workspace: AbstractWorkspace, editor: Editor,
@@ -146,15 +146,6 @@ class TestBaseLauncher:
mock_stop_ap.assert_called_once()
@mock.patch('ly_test_tools.launchers.platforms.base.Launcher.save_project_log_files')
def test_Teardown_TeardownCalled_CallsSaveProjectLogFiles(self, under_test):
mock_workspace = mock.MagicMock()
mock_args = ['foo']
mock_launcher = ly_test_tools.launchers.Launcher(mock_workspace, mock_args)
mock_launcher.teardown()
under_test.assert_called_once()
@mock.patch('os.path.exists', mock.MagicMock(return_value=True))
@mock.patch('ly_test_tools._internal.managers.artifact_manager.ArtifactManager.save_artifact')
@mock.patch('os.listdir')