address feedback from PR

Signed-off-by: greerdv <greerdv@amazon.com>
This commit is contained in:
greerdv
2021-11-11 15:10:46 +00:00
parent 53c6a22ac2
commit 9d05168cfc
4 changed files with 16 additions and 12 deletions
@@ -93,14 +93,14 @@ class TestAutomation(TestAutomationBase):
from .tests import Physics_UndoRedoWorksOnEntityWithPhysComponents as test_module
self._run_test(request, workspace, editor, test_module)
@pytest.mark.tick
@pytest.mark.GROUP_tick
@pytest.mark.xfail(reason="Test still under development.")
def test_Tick_InterpolatedRigidBodyMotionIsSmooth(self, request, workspace, editor, launcher_platform):
from .tests.tick import Tick_InterpolatedRigidBodyMotionIsSmooth as test_module
self._run_test(request, workspace, editor, test_module)
@pytest.mark.tick
@pytest.mark.GROUP_tick
@pytest.mark.xfail(reason="Test still under development.")
def test_Tick_Tick_CharacterGameplayComponentMotionIsSmooth(self, request, workspace, editor, launcher_platform):
def test_Tick_CharacterGameplayComponentMotionIsSmooth(self, request, workspace, editor, launcher_platform):
from .tests.tick import Tick_CharacterGameplayComponentMotionIsSmooth as test_module
self._run_test(request, workspace, editor, test_module)
@@ -13,6 +13,8 @@ class Tests():
create_entity = ("Created test entity", "Failed to create test entity")
character_controller_added = ("Added PhysX Character Controller component", "Failed to add PhysX Character Controller component")
character_gameplay_added = ("Added PhysX Character Gameplay component", "Failed to add PhysX Character Gameplay component")
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
character_motion_smooth = ("Character motion passed smoothness threshold", "Failed to meet smoothness threshold for character motion")
# fmt: on
@@ -50,7 +52,7 @@ def Tick_CharacterGameplayComponentMotionIsSmooth():
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
helper.open_level("", "Base")
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")
@@ -68,14 +70,14 @@ def Tick_CharacterGameplayComponentMotionIsSmooth():
# 4) Enter game mode and collect data for the rigid body's z co-ordinate and the time values for a series of frames
t = []
z = []
general.enter_game_mode()
helper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
game_entity_id = general.find_game_entity("test_entity")
for timestep in range(100):
for frame in range(100):
t.append(azlmbr.components.TickRequestBus(azlmbr.bus.Broadcast, "GetTimeAtCurrentTick").GetSeconds())
z.append(azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldZ", game_entity_id))
general.idle_wait_frames(1)
general.exit_game_mode()
helper.exit_game_mode(Tests.exit_game_mode)
# 5) Test that the z vs t curve is sufficiently smooth (if the interpolation is not working well, the curve will be less smooth)
# normalize the t and z data
@@ -12,6 +12,8 @@ Test Case Title : Verify that a rigid body with "Interpolate motion" option sele
class Tests():
create_entity = ("Created test entity", "Failed to create test entity")
rigid_body_added = ("Added PhysX Rigid Body component", "Failed to add PhysX Rigid Body component")
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
exit_game_mode = ("Exited game mode", "Failed to exit game mode")
rigid_body_smooth = ("Rigid body motion passed smoothness threshold", "Failed to meet smoothness threshold for rigid body motion")
# fmt: on
@@ -49,7 +51,7 @@ def Tick_InterpolatedRigidBodyMotionIsSmooth():
helper.init_idle()
# 1) Load the empty level
helper.open_level("Physics", "Base")
helper.open_level("", "Base")
# 2) Create an entity
test_entity = Entity.create_editor_entity("test_entity")
@@ -67,14 +69,14 @@ def Tick_InterpolatedRigidBodyMotionIsSmooth():
# 4) Enter game mode and collect data for the rigid body's z co-ordinate and the time values for a series of frames
t = []
z = []
general.enter_game_mode()
helper.enter_game_mode(Tests.enter_game_mode)
general.idle_wait_frames(1)
game_entity_id = general.find_game_entity("test_entity")
for timestep in range(100):
for frame in range(100):
t.append(azlmbr.components.TickRequestBus(azlmbr.bus.Broadcast, "GetTimeAtCurrentTick").GetSeconds())
z.append(azlmbr.components.TransformBus(azlmbr.bus.Event, "GetWorldZ", game_entity_id))
general.idle_wait_frames(1)
general.exit_game_mode()
helper.exit_game_mode(Tests.exit_game_mode)
# 5) Test that the z vs t curve is sufficiently smooth (if the interpolation is not working well, the curve will be less smooth)
# normalize the t and z data
+1 -1
View File
@@ -22,5 +22,5 @@ markers = SUITE_smoke: Tiny, quick tests of fundamental operation (tests with no
SUITE_awsi: Time consuming AWS integration end-to-end tests
# secondary markers which may appear alongisde a suite marker:
REQUIRES_gpu: Tests which require a physical GPU
tick: Tests which verify if systems update correctly with system ticks (for example, physics bodies should move smoothly)
GROUP_tick: Tests which verify if systems update correctly with system ticks (for example, physics bodies should move smoothly)
# custom markers not listed above will cause pytest to emit a typo warning