TestSuite_Main.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. import pytest
  7. import os
  8. import sys
  9. from ly_test_tools.o3de.editor_test import EditorTestSuite, EditorSingleTest
  10. sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../automatedtesting_shared')
  11. from ly_test_tools.environment import process_utils
  12. from ly_test_tools.launchers import launcher_helper
  13. from ly_test_tools.log.log_monitor import LogMonitor
  14. import ly_test_tools.environment.waiter as waiter
  15. # Saves the level cache folder.
  16. # These artifacts will be saved in the test results so developers can access the level assets
  17. # to debug should the test ever fail.
  18. def save_multiplayer_level_cache_folder_artifact(workspace, multiplayer_level):
  19. level_cache_folder_path = os.path.join(workspace.paths.platform_cache(), "levels", "multiplayer", multiplayer_level)
  20. if os.path.exists(level_cache_folder_path):
  21. workspace.artifact_manager.save_artifact(level_cache_folder_path)
  22. else:
  23. pytest.fail(f"Failed to find level asset cache for '{multiplayer_level}', located here: '{level_cache_folder_path}'! Make sure AssetProcessor successfully built the level.")
  24. @pytest.mark.SUITE_main
  25. @pytest.mark.parametrize("project", ["AutomatedTesting"])
  26. @pytest.mark.parametrize("launcher_platform", ['windows_editor'])
  27. class TestAutomation(EditorTestSuite):
  28. class test_Multiplayer_BasicConnectivity_Connects(EditorSingleTest):
  29. from .tests import Multiplayer_BasicConnectivity_Connects as test_module
  30. timeout = 60.0 * 15.0 # increase timeout to ~15 minutes to accommodate for slow server startup
  31. def __init__(self):
  32. super(test_Multiplayer_BasicConnectivity_Connects, self).__init__()
  33. @classmethod
  34. def setup(cls, instance, request, workspace):
  35. save_multiplayer_level_cache_folder_artifact(workspace, "basicconnectivity_connects")
  36. class test_Multiplayer_BasicConnectivity_Connects_ClientServer(EditorSingleTest):
  37. from .tests import Multiplayer_BasicConnectivity_Connects_ClientServer as test_module
  38. timeout = 60.0 * 15.0 # increase timeout to ~15 minutes to accommodate for slow server startup
  39. def __init__(self):
  40. super(test_Multiplayer_BasicConnectivity_Connects_ClientServer, self).__init__()