Convert prefab to temp spawnable assets (#6179)
* Convert prefab to temp in-memory spawnable assets Signed-off-by: chiyenteng <82238204+chiyenteng@users.noreply.github.com>
This commit is contained in:
@@ -43,6 +43,8 @@ import types
|
||||
import functools
|
||||
import re
|
||||
|
||||
from os import path
|
||||
|
||||
import ly_test_tools.environment.file_system as file_system
|
||||
import ly_test_tools.environment.waiter as waiter
|
||||
import ly_test_tools.environment.process_utils as process_utils
|
||||
@@ -745,7 +747,9 @@ class EditorTestSuite():
|
||||
if test_spec.wait_for_debugger:
|
||||
test_cmdline_args += ["--wait-for-debugger"]
|
||||
if self.enable_prefab_system:
|
||||
test_cmdline_args += ["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
test_cmdline_args += [
|
||||
"--regset=/Amazon/Preferences/EnablePrefabSystem=true",
|
||||
f"--regset-file={path.join(workspace.paths.engine_root(), 'Registry', 'prefab.test.setreg')}"]
|
||||
else:
|
||||
test_cmdline_args += ["--regset=/Amazon/Preferences/EnablePrefabSystem=false"]
|
||||
|
||||
@@ -812,7 +816,9 @@ class EditorTestSuite():
|
||||
if any([t.wait_for_debugger for t in test_spec_list]):
|
||||
test_cmdline_args += ["--wait-for-debugger"]
|
||||
if self.enable_prefab_system:
|
||||
test_cmdline_args += ["--regset=/Amazon/Preferences/EnablePrefabSystem=true"]
|
||||
test_cmdline_args += [
|
||||
"--regset=/Amazon/Preferences/EnablePrefabSystem=true",
|
||||
f"--regset-file={path.join(workspace.paths.engine_root(), 'Registry', 'prefab.test.setreg')}"]
|
||||
else:
|
||||
test_cmdline_args += ["--regset=/Amazon/Preferences/EnablePrefabSystem=false"]
|
||||
|
||||
|
||||
@@ -594,6 +594,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_output_results, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_test_spec = mock.MagicMock()
|
||||
mock_test_spec.__name__ = 'mock_test_name'
|
||||
@@ -620,6 +621,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_output_results, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_test_spec = mock.MagicMock()
|
||||
mock_test_spec.__name__ = 'mock_test_name'
|
||||
@@ -647,6 +649,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_output_results, mock_retrieve_crash, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_test_spec = mock.MagicMock()
|
||||
mock_test_spec.__name__ = 'mock_test_name'
|
||||
@@ -674,6 +677,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_output_results, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_test_spec = mock.MagicMock()
|
||||
mock_test_spec.__name__ = 'mock_test_name'
|
||||
@@ -699,6 +703,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_retrieve_log, mock_retrieve_editor_log, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_editor.get_returncode.return_value = 0
|
||||
mock_test_spec = mock.MagicMock()
|
||||
@@ -726,6 +731,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_retrieve_log, mock_retrieve_editor_log, mock_get_results):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_editor.get_returncode.return_value = 15
|
||||
mock_test_spec = mock.MagicMock()
|
||||
@@ -751,6 +757,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_results, mock_retrieve_crash, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_editor.get_returncode.return_value = 1
|
||||
mock_test_spec = mock.MagicMock()
|
||||
@@ -785,6 +792,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_results, mock_retrieve_crash, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_editor.get_returncode.return_value = 1
|
||||
mock_test_spec = mock.MagicMock()
|
||||
@@ -821,6 +829,7 @@ class TestRunningTests(unittest.TestCase):
|
||||
mock_get_results, mock_create):
|
||||
mock_test_suite = ly_test_tools.o3de.editor_test.EditorTestSuite()
|
||||
mock_workspace = mock.MagicMock()
|
||||
mock_workspace.paths.engine_root.return_value = ""
|
||||
mock_editor = mock.MagicMock()
|
||||
mock_editor.wait.side_effect = ly_test_tools.launchers.exceptions.WaitTimeoutError()
|
||||
mock_test_spec = mock.MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user