TestSuite_InDevelopment.py 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. """
  2. Copyright (c) Contributors to the Open 3D Engine Project.
  3. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. SPDX-License-Identifier: Apache-2.0 OR MIT
  5. """
  6. # This suite consists of all test cases that are under development and have not been verified yet.
  7. import pytest
  8. import os
  9. import sys
  10. from .utils.FileManagement import FileManagement as fm
  11. from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorBatchedTest, EditorTestSuite
  12. sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
  13. from base import TestAutomationBase
  14. revert_physics_config = fm.file_revert_list(['physxdebugconfiguration.setreg', 'physxdefaultsceneconfiguration.setreg', 'physxsystemconfiguration.setreg'], 'AutomatedTesting/Registry')
  15. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  16. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  17. class TestAutomation(TestAutomationBase):
  18. @revert_physics_config
  19. @fm.file_override('physxsystemconfiguration.setreg','Material_Restitution.setreg_override',
  20. 'AutomatedTesting/Registry', search_subdirs=True)
  21. def test_Material_Restitution(self, request, workspace, editor, launcher_platform):
  22. from .tests.material import Material_Restitution as test_module
  23. self._run_test(request, workspace, editor, test_module)
  24. def test_Physics_WorldBodyBusWorksOnEditorComponents(self, request, workspace, editor, launcher_platform):
  25. from .tests import Physics_WorldBodyBusWorksOnEditorComponents as test_module
  26. self._run_test(request, workspace, editor, test_module)
  27. # Custom test spec, it provides functionality to override files
  28. class EditorSingleTest_WithFileOverrides(EditorSingleTest):
  29. # Specify here what files to override, [(original, override), ...]
  30. files_to_override = [()]
  31. # Base directory of the files (Default path is {ProjectName})
  32. base_dir = None
  33. # True will will search sub-directories for the files in base
  34. search_subdirs = True
  35. @classmethod
  36. def wrap_run(cls, instance, request, workspace, editor_test_results):
  37. root_path = cls.base_dir
  38. if root_path is not None:
  39. root_path = os.path.join(workspace.paths.engine_root(), root_path)
  40. else:
  41. # Default to project folder
  42. root_path = workspace.paths.project()
  43. # Try to locate both target and source files
  44. original_file_list, override_file_list = zip(*cls.files_to_override)
  45. try:
  46. file_list = fm._find_files(original_file_list + override_file_list, root_path, cls.search_subdirs)
  47. except RuntimeWarning as w:
  48. assert False, (
  49. w.message
  50. + " Please check use of search_subdirs; make sure you are using the correct parent directory."
  51. )
  52. for f in original_file_list:
  53. fm._restore_file(f, file_list[f])
  54. fm._backup_file(f, file_list[f])
  55. for original, override in cls.files_to_override:
  56. fm._copy_file(override, file_list[override], original, file_list[original])
  57. yield # Run Test
  58. for f in original_file_list:
  59. fm._restore_file(f, file_list[f])
  60. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  61. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  62. class EditorTestAutomation(EditorTestSuite):
  63. global_extra_cmdline_args = ['-BatchMode', '-autotest_mode']
  64. @staticmethod
  65. def get_number_parallel_editors():
  66. return 16
  67. class Collider_MultipleSurfaceSlots(EditorBatchedTest):
  68. from .tests.collider import Collider_MultipleSurfaceSlots as test_module
  69. @pytest.mark.GROUP_tick
  70. @pytest.mark.xfail(reason="Test still under development.")
  71. class Tick_InterpolatedRigidBodyMotionIsSmooth(EditorBatchedTest):
  72. from .tests.tick import Tick_InterpolatedRigidBodyMotionIsSmooth as test_module
  73. @pytest.mark.GROUP_tick
  74. @pytest.mark.xfail(reason="Test still under development.")
  75. class Tick_CharacterGameplayComponentMotionIsSmooth(EditorBatchedTest):
  76. from .tests.tick import Tick_CharacterGameplayComponentMotionIsSmooth as test_module
  77. @pytest.mark.xfail(reason="AssertionError: Couldn't find Asset with path: Objects/SphereBot/r0-b_body.fbx.azmodel")
  78. class Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent(EditorBatchedTest):
  79. from .tests.collider import Collider_PxMeshAutoAssignedWhenModifyingRenderMeshComponent as test_module
  80. @pytest.mark.skip(reason="GHI #9301: Test Periodically Fails")
  81. class Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx(EditorBatchedTest):
  82. from .tests.collider import Collider_PxMeshNotAutoAssignedWhenNoPhysicsFbx as test_module