pulling in latest

Signed-off-by: Scott Murray <scottmur@amazon.com>
This commit is contained in:
Scott Murray
2022-02-15 13:10:12 -08:00
507 changed files with 16931 additions and 7774 deletions
@@ -162,11 +162,11 @@ def select_model_config(configname):
azlmbr.materialeditor.MaterialViewportRequestBus(azlmbr.bus.Broadcast, "SelectModelPresetByName", configname)
def destroy_main_window():
def exit():
"""
Closes the Material Editor window
Closes the Material Editor
"""
azlmbr.atomtools.AtomToolsMainWindowFactoryRequestBus(azlmbr.bus.Broadcast, "DestroyMainWindow")
azlmbr.atomtools.general.exit()
def wait_for_condition(function, timeout_in_seconds=1.0):
@@ -214,7 +214,7 @@ def run():
(not material_editor.is_open(document1_id)) and
(not material_editor.is_open(document2_id)) and
(not material_editor.is_open(document3_id)), 2.0)
material_editor.destroy_main_window()
material_editor.exit()
if __name__ == "__main__":
@@ -67,3 +67,6 @@ add_subdirectory(Multiplayer)
## Integration tests for editor testing framework ##
add_subdirectory(editor_test_testing)
## Performance ##
add_subdirectory(Performance)
@@ -0,0 +1,39 @@
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED OR NOT PAL_TRAIT_BUILD_HOST_TOOLS)
return()
endif()
ly_add_pytest(
NAME AutomatedTesting::EditorLevelLoadingPerfTests_DX12
TEST_SUITE periodic
TEST_REQUIRES gpu
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic_DX12.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Performance
)
ly_add_pytest(
NAME AutomatedTesting::EditorLevelLoadingPerfTests_Vulkan
TEST_SUITE periodic
TEST_REQUIRES gpu
TEST_SERIAL
PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic_Vulkan.py
RUNTIME_DEPENDENCIES
Legacy::Editor
AZ::AssetProcessor
AutomatedTesting.Assets
COMPONENT
Performance
)
@@ -0,0 +1,31 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
import sys
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAutomation(EditorTestSuite):
class Time_EditorLevelLoading_10KEntityCpuPerfTest(EditorSingleTest):
extra_cmdline_args = ['-rhi=dx12']
use_null_renderer = False # needs renderer to validate test
from .tests import EditorLevelLoading_10KEntityCpuPerfTest as test_module
class Time_EditorLevelLoading_10kVegInstancesTest(EditorSingleTest):
extra_cmdline_args = ['-rhi=dx12']
use_null_renderer = False # needs renderer to validate test
from .tests import EditorLevelLoading_10kVegInstancesTest as test_module
@@ -0,0 +1,34 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# This suite consists of all test cases that are passing and have been verified.
import pytest
import os
import sys
from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.parametrize("launcher_platform", ['windows_editor'])
class TestAutomation(EditorTestSuite):
class Time_EditorLevelLoading_10KEntityCpuPerfTest(EditorSingleTest):
# there is currently a huge discrepancy loading this level with vulkan compared to dx12 which requires the 10 min timeout
# this should be removed once that issue has been sorted out
timeout = 600
extra_cmdline_args = ['-rhi=vulkan']
use_null_renderer = False # needs renderer to validate test
from .tests import EditorLevelLoading_10KEntityCpuPerfTest as test_module
class Time_EditorLevelLoading_10kVegInstancesTest(EditorSingleTest):
extra_cmdline_args = ['-rhi=vulkan']
use_null_renderer = False # needs renderer to validate test
from .tests import EditorLevelLoading_10kVegInstancesTest as test_module
@@ -0,0 +1,6 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
@@ -0,0 +1,15 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
from Performance.utils.perf_timer import time_editor_level_loading
def EditorLevelLoading_10KEntityCpuPerfTest():
time_editor_level_loading('Performance', '10KEntityCpuPerfTest')
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(EditorLevelLoading_10KEntityCpuPerfTest)
@@ -0,0 +1,15 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
from Performance.utils.perf_timer import time_editor_level_loading
def EditorLevelLoading_10kVegInstancesTest():
time_editor_level_loading('Performance', '10kVegInstancesTest')
if __name__ == "__main__":
from editor_python_test_tools.utils import Report
Report.start_test(EditorLevelLoading_10kVegInstancesTest)
@@ -0,0 +1,6 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
@@ -0,0 +1,6 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
@@ -0,0 +1,72 @@
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import time
ENTER_MSG = ("Entered game mode", "Failed to enter game mode")
EXIT_MSG = ("Exited game mode", "Couldn't exit game mode")
class Timer:
unit_divisor = 60
hour_divisor = unit_divisor * unit_divisor
def start(self):
self._start_time = time.perf_counter()
def log_time(self, message):
from editor_python_test_tools.utils import Report
elapsed_time = time.perf_counter() - self._start_time
hours = int(elapsed_time / Timer.hour_divisor)
minutes = int(elapsed_time % Timer.hour_divisor / Timer.unit_divisor)
seconds = elapsed_time % Timer.unit_divisor
Report.info(f'{message}: {hours:0>2d}:{minutes:0>2d}:{seconds:0>5.2f}\n')
def time_editor_level_loading(level_dir, level_name):
"""
Summary:
Time how long it takes to load an arbitrary level, entering game mode, and exiting game mode
Level Description:
Preferably a level with a large number of entities
Expected Behavior:
Level loads within a reasonable time frame e.i. doesn't trip the framework timeout
Benchmark Steps:
1) Time opening the level
2) Time entering game mode
3) Time exiting game mode
4) Close the editor
:return: None
"""
from editor_python_test_tools.utils import TestHelper as helper
timer = Timer()
helper.init_idle()
# 1) Open level
timer.start()
helper.open_level(level_dir, level_name)
timer.log_time('Level load time')
# 2) Time how long it takes to enter game mode
timer.start()
helper.enter_game_mode(ENTER_MSG)
timer.log_time('Enter game mode')
# 3) Exit game mode
timer.start()
helper.exit_game_mode(EXIT_MSG)
timer.log_time('Exit game mode')
# 4) Close the editor
helper.close_editor()