From c32f00d73f112ddbfb2bea91cc4801d19dfea3e6 Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Wed, 7 Jul 2021 11:54:00 -0500 Subject: [PATCH 1/7] Updating/re-enabling skipped/xfailed Dynamic Vegetation automated tests Signed-off-by: jckand-amzn --- .../hydra_test_utils.py | 6 ++--- .../AltitudeFilter_FilterStageToggle.py | 24 +++---------------- ...ynamicSliceInstanceSpawner_Embedded_E2E.py | 19 ++++++--------- ...ynamicSliceInstanceSpawner_External_E2E.py | 23 +++++++----------- .../test_DynamicSliceInstanceSpawner.py | 2 -- .../editor_dynveg_test_helper.py | 4 ++-- 6 files changed, 24 insertions(+), 54 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py index 2583109573..bb71d30d98 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py @@ -89,7 +89,7 @@ def launch_and_validate_results_launcher(launcher, level, remote_console_instanc :return: True if port is listening. """ port_listening = False - for conn in psutil.net_connections(): + for conn in process_utils.psutil.net_connections(): if 'port={}'.format(port) in str(conn): port_listening = True return port_listening @@ -110,8 +110,8 @@ def launch_and_validate_results_launcher(launcher, level, remote_console_instanc # Load the specified level in the launcher send_command_and_expect_response(remote_console_instance, - f"map {level}", - "LEVEL_LOAD_COMPLETE", timeout=30) + f"LoadLevel {level}", + "LEVEL_LOAD_END", timeout=30) # Monitor the console for expected lines for line in expected_lines: diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py index bbdb925585..2fac361ced 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/AltitudeFilter_FilterStageToggle.py @@ -36,8 +36,8 @@ class TestAltitudeFilterFilterStageToggle(EditorTestHelper): :return: None """ - PREPROCESS_INSTANCE_COUNT = 24 - POSTPROCESS_INSTANCE_COUNT = 18 + PREPROCESS_INSTANCE_COUNT = 44 + POSTPROCESS_INSTANCE_COUNT = 34 # Create empty level self.test_success = self.create_level( @@ -62,25 +62,7 @@ class TestAltitudeFilterFilterStageToggle(EditorTestHelper): dynveg.create_surface_entity("Surface_Entity_Parent", position, 16.0, 16.0, 1.0) # Add entity with Mesh to replicate creation of hills - hill_entity = dynveg.create_mesh_surface_entity_with_slopes("hill", position, 40.0, 40.0, 40.0) - - # Disable/Re-enable Mesh component due to ATOM-14299 - general.idle_wait(1.0) - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is still enabled") - else: - print("Mesh component was disabled") - editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is now enabled") - else: - print("Mesh component is still disabled") - - # Increase Box Shape size to encompass the hills - vegetation.get_set_test(1, "Box Shape|Box Configuration|Dimensions", math.Vector3(100.0, 100.0, 100.0)) + hill_entity = dynveg.create_mesh_surface_entity_with_slopes("hill", position, 10.0) # Set a Min Altitude of 38 and Max of 40 in Vegetation Altitude Filter vegetation.get_set_test(3, "Configuration|Altitude Min", 38.0) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py index 4b0951acaf..6a99979a1f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_Embedded_E2E.py @@ -9,9 +9,10 @@ import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) import azlmbr.asset as asset +import azlmbr.components as components import azlmbr.legacy.general as general import azlmbr.bus as bus -import azlmbr.entity as EntityId +import azlmbr.entity as entity import azlmbr.editor as editor import azlmbr.math as math import azlmbr.paths @@ -83,18 +84,12 @@ class TestDynamicSliceInstanceSpawnerEmbeddedEditor(EditorTestHelper): self.log(f"Expected {num_expected_instances} instances - Found {num_found} instances") self.test_success = self.test_success and num_found == num_expected_instances - # 5) Create a new entity with a Camera component for testing in the launcher + # 5) Move the default Camera entity for testing in the launcher cam_position = math.Vector3(512.0, 500.0, 35.0) - camera_component = ["Camera"] - new_entity_id2 = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", cam_position, EntityId.EntityId() - ) - if new_entity_id2.IsValid(): - self.log("Camera entity created") - camera_entity = hydra.Entity("Camera Entity", new_entity_id2) - camera_entity.components = [] - for component in camera_component: - camera_entity.components.append(hydra.add_component(component, new_entity_id2)) + search_filter = entity.SearchFilter() + search_filter.names = ["Camera"] + search_entity_ids = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) # 6) Save and export to engine general.save_level() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py index 892549d414..70030ff359 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/DynamicSliceInstanceSpawner_External_E2E.py @@ -11,7 +11,8 @@ sys.path.append(os.path.dirname(os.path.abspath(__file__))) import azlmbr.legacy.general as general import azlmbr.asset as asset import azlmbr.bus as bus -import azlmbr.entity as EntityId +import azlmbr.components as components +import azlmbr.entity as entity import azlmbr.editor as editor import azlmbr.math as math import azlmbr.paths @@ -68,7 +69,7 @@ class TestDynamicSliceInstanceSpawnerExternalEditor(EditorTestHelper): veg_area_required_components = ["Vegetation Layer Spawner", "Box Shape", "Vegetation Asset List", "Script Canvas"] new_entity_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() + bus.Broadcast, "CreateNewEntityAtPosition", entity_position, entity.EntityId() ) if new_entity_id.IsValid(): self.log("Spawner entity created") @@ -106,18 +107,12 @@ class TestDynamicSliceInstanceSpawnerExternalEditor(EditorTestHelper): self.log(f"Expected {num_expected_instances} instances - Found {num_found} instances") self.test_success = self.test_success and num_found == num_expected_instances - # 5) Create a new entity with a Camera component for testing in the launcher - entity_position = math.Vector3(512.0, 500.0, 35.0) - camera_component = ["Camera"] - new_entity_id2 = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() - ) - if new_entity_id2.IsValid(): - self.log("Camera entity created") - camera_entity = hydra.Entity("Camera Entity", new_entity_id2) - camera_entity.components = [] - for component in camera_component: - camera_entity.components.append(hydra.add_component(component, new_entity_id2)) + # 5) Move the default Camera entity for testing in the launcher + cam_position = math.Vector3(512.0, 500.0, 35.0) + search_filter = entity.SearchFilter() + search_filter.names = ["Camera"] + search_entity_ids = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) # 6) Save and export to engine general.save_level() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py index 053c4ccbfd..eb74a5a144 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py @@ -90,7 +90,6 @@ class TestDynamicSliceInstanceSpawner(object): @pytest.mark.SUITE_periodic @pytest.mark.dynveg_area @pytest.mark.parametrize("launcher_platform", ['windows']) - @pytest.mark.skip # ATOM-14703 def test_DynamicSliceInstanceSpawner_Embedded_E2E_Launcher(self, workspace, launcher, level, remote_console_instance, project, launcher_platform): @@ -126,7 +125,6 @@ class TestDynamicSliceInstanceSpawner(object): @pytest.mark.SUITE_periodic @pytest.mark.dynveg_area @pytest.mark.parametrize("launcher_platform", ['windows']) - @pytest.mark.skip # ATOM-14703 def test_DynamicSliceInstanceSpawner_External_E2E_Launcher(self, workspace, launcher, level, remote_console_instance, project, launcher_platform): diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py index 515009cb3a..09d4746fa6 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/large_worlds_utils/editor_dynveg_test_helper.py @@ -34,7 +34,7 @@ def create_surface_entity(name, center_point, box_size_x, box_size_y, box_size_z return surface_entity -def create_mesh_surface_entity_with_slopes(name, center_point, scale_x, scale_y, scale_z): +def create_mesh_surface_entity_with_slopes(name, center_point, uniform_scale): # Creates an entity with the assigned mesh_asset as the specified scale and sets up as a planting surface mesh_asset_path = os.path.join("models", "sphere.azmodel") mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(), @@ -47,7 +47,7 @@ def create_mesh_surface_entity_with_slopes(name, center_point, scale_x, scale_y, if surface_entity.id.IsValid(): print(f"'{surface_entity.name}' created") hydra.get_set_test(surface_entity, 0, "Controller|Configuration|Mesh Asset", mesh_asset) - components.TransformBus(bus.Event, "SetLocalScale", surface_entity.id, math.Vector3(scale_x, scale_y, scale_z)) + components.TransformBus(bus.Event, "SetLocalUniformScale", surface_entity.id, uniform_scale) return surface_entity From 78752a23a76bf6b8d3f172a5c8cf6d90828e2417 Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Wed, 7 Jul 2021 14:30:24 -0500 Subject: [PATCH 2/7] Updating null renderer argument for launcher tests Signed-off-by: jckand-amzn --- .../editor_python_test_tools/hydra_test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py index bb71d30d98..343eb5b12d 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py @@ -95,7 +95,7 @@ def launch_and_validate_results_launcher(launcher, level, remote_console_instanc return port_listening if null_renderer: - launcher.args.extend(["-NullRenderer"]) + launcher.args.extend(["-rhi=Null"]) # Start the Launcher with launcher.start(): From 0a68bbdf7ce830d8cf4a09da8037354d648c6b86 Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Wed, 7 Jul 2021 15:28:55 -0500 Subject: [PATCH 3/7] Updating camera position and null renderer args for launcher test Signed-off-by: jckand-amzn --- .../EditorScripts/LayerBlender_E2E_Editor.py | 26 +++++++------------ .../largeworlds/dyn_veg/test_LayerBlender.py | 4 +-- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py index c4dfbbf4fe..3543b4c23c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerBlender_E2E_Editor.py @@ -18,9 +18,9 @@ import azlmbr.areasystem as areasystem import azlmbr.legacy.general as general import azlmbr import azlmbr.bus as bus -import azlmbr.editor as editor +import azlmbr.components as components import azlmbr.math as math -import azlmbr.entity as EntityId +import azlmbr.entity as entity import azlmbr.paths sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) @@ -134,20 +134,14 @@ class TestVegLayerBlenderCreated(EditorTestHelper): purple_count += 1 self.test_success = pink_count == purple_count and (pink_count + purple_count == num_expected) and self.test_success - # 5) Create a new entity with a Camera component for testing in the launcher - entity_position = math.Vector3(500.0, 500.0, 47.0) - rot_degrees_vector = math.Vector3(radians(-55.0), radians(28.5), radians(-17.0)) - camera_component = ["Camera"] - camera_id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, EntityId.EntityId() - ) - if camera_id.IsValid(): - self.log("Camera entity created") - camera_entity = hydra.Entity("Camera Entity", camera_id) - camera_entity.components = [] - for component in camera_component: - camera_entity.components.append(hydra.add_component(component, camera_id)) - azlmbr.components.TransformBus(bus.Event, "SetLocalRotation", camera_id, rot_degrees_vector) + # 5) Move the default Camera entity for testing in the launcher + cam_position = math.Vector3(500.0, 500.0, 47.0) + cam_rot_degrees_vector = math.Vector3(radians(-55.0), radians(28.5), radians(-17.0)) + search_filter = entity.SearchFilter() + search_filter.names = ["Camera"] + search_entity_ids = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + components.TransformBus(bus.Event, "MoveEntity", search_entity_ids[0], cam_position) + azlmbr.components.TransformBus(bus.Event, "SetLocalRotation", search_entity_ids[0], cam_rot_degrees_vector) # 6) Save and export level general.save_level() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py index 3c16420a30..2620a7d50a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerBlender.py @@ -68,7 +68,6 @@ class TestLayerBlender(object): "Entity has a Box Shape component", "Blender Configuration|Vegetation Areas: SUCCESS", "Blender Box Shape|Box Configuration|Dimensions: SUCCESS", - "Camera entity created", "LayerBlender_E2E_Editor: result=SUCCESS" ] @@ -85,12 +84,11 @@ class TestLayerBlender(object): @pytest.mark.BAT @pytest.mark.SUITE_periodic @pytest.mark.dynveg_area - @pytest.mark.xfail @pytest.mark.parametrize("launcher_platform", ['windows']) def test_LayerBlender_E2E_Launcher(self, workspace, project, launcher, level, remote_console_instance, launcher_platform): - launcher.args.extend(["-NullRenderer"]) + launcher.args.extend(["-rhi=Null"]) launcher.start() assert launcher.is_alive(), "Launcher failed to start" From 9f5e91be88a0ecaa7b71c3e2b1582c524a322f9b Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Fri, 9 Jul 2021 15:43:44 -0500 Subject: [PATCH 4/7] Updating utility path for test import, and updating linked issue to disabled test Signed-off-by: jckand-amzn --- ...ayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py | 2 +- .../Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py index c99d180253..4752aeddbc 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py @@ -13,7 +13,7 @@ import azlmbr.legacy.general as general import azlmbr.math as math sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) -from automatedtesting_shared.editor_test_helper import EditorTestHelper +from editor_python_test_tools.editor_test_helper import EditorTestHelper from largeworlds.large_worlds_utils import editor_dynveg_test_helper as dynveg diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py index 410bdbafed..2af848ffb1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_LayerSpawner.py @@ -121,7 +121,7 @@ class TestLayerSpawner(object): @pytest.mark.test_case_id("C30000751") @pytest.mark.SUITE_sandbox @pytest.mark.dynveg_misc - @pytest.mark.skip # ATOM-14828 + @pytest.mark.skip # https://github.com/o3de/o3de/issues/2038 def test_LayerSpawner_InstancesRefreshUsingCorrectViewportCamera(self, request, editor, level, launcher_platform): expected_lines = [ @@ -136,5 +136,6 @@ class TestLayerSpawner(object): editor, "LayerSpawner_InstancesRefreshUsingCorrectViewportCamera.py", expected_lines, - cfg_args=[level] + cfg_args=[level], + null_renderer=False ) From ea99ed11a3529a102b64762be6988096abdeb3bb Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Fri, 9 Jul 2021 16:52:22 -0500 Subject: [PATCH 5/7] Updating mesh surface creation, filtering, and expected instance counts Signed-off-by: jckand-amzn --- .../LayerSpawner_FilterStageToggle.py | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py index 0224f6bc0a..fb1ac5a5ce 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/LayerSpawner_FilterStageToggle.py @@ -34,8 +34,8 @@ class TestLayerSpawnerFilterStageToggle(EditorTestHelper): :return: None """ - PREPROCESS_INSTANCE_COUNT = 425 - POSTPROCESS_INSTANCE_COUNT = 430 + PREPROCESS_INSTANCE_COUNT = 21 + POSTPROCESS_INSTANCE_COUNT = 19 # Create empty level self.test_success = self.create_level( @@ -56,7 +56,6 @@ class TestLayerSpawnerFilterStageToggle(EditorTestHelper): vegetation_entity.add_component("Vegetation Altitude Filter") vegetation_entity.add_component("Vegetation Position Modifier") - # Create a child entity under vegetation area child_entity = hydra.Entity("child_entity") components_to_add = ["Random Noise Gradient", "Gradient Transform Modifier", "Box Shape"] @@ -66,29 +65,13 @@ class TestLayerSpawnerFilterStageToggle(EditorTestHelper): vegetation_entity.get_set_test(4, "Configuration|Position X|Gradient|Gradient Entity Id", child_entity.id) vegetation_entity.get_set_test(4, "Configuration|Position Y|Gradient|Gradient Entity Id", child_entity.id) - # Set the min and max values for Altitude Filter - vegetation_entity.get_set_test(3, "Configuration|Altitude Min", 32.0) - vegetation_entity.get_set_test(3, "Configuration|Altitude Max", 35.0) + vegetation_entity.get_set_test(3, "Configuration|Altitude Min", 34.0) + vegetation_entity.get_set_test(3, "Configuration|Altitude Max", 38.0) # Add entity with Mesh to replicate creation of hills and a flat surface to plant on dynveg.create_surface_entity("Flat Surface", position, 32.0, 32.0, 1.0) - hill_entity = dynveg.create_mesh_surface_entity_with_slopes("hill", position, 4.0, 4.0, 4.0) - - # Disable/Re-enable Mesh component due to ATOM-14299 - general.idle_wait(1.0) - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is still enabled") - else: - print("Mesh component was disabled") - editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [hill_entity.components[0]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', hill_entity.components[0]) - if is_enabled: - print("Mesh component is now enabled") - else: - print("Mesh component is still disabled") + hill_entity = dynveg.create_mesh_surface_entity_with_slopes("hill", position, 4.0) # Set the filter stage to preprocess and postprocess respectively and verify instance count vegetation_entity.get_set_test(0, "Configuration|Filter Stage", 1) From 35a60cdf1a7a85b61c669103c5e5b9f0d6ceedeb Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Fri, 9 Jul 2021 17:34:36 -0500 Subject: [PATCH 6/7] Removing unnecessary Mesh component refreshes and updating calls to scale meshes Signed-off-by: jckand-amzn --- .../MeshBlocker_InstancesBlockedByMesh.py | 17 +---------------- ...locker_InstancesBlockedByMeshHeightTuning.py | 17 +---------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py index d23f811f58..89367ca475 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMesh.py @@ -82,22 +82,7 @@ class test_MeshBlocker_InstancesBlockedByMesh(EditorTestHelper): bus.Broadcast, "GetAssetIdByPath", os.path.join("objects", "_primitives", "_box_1x1.azmodel"), math.Uuid(), False) blocker_entity.get_set_test(1, "Controller|Configuration|Mesh Asset", cubeId) - components.TransformBus(bus.Event, "SetLocalScale", blocker_entity.id, math.Vector3(2.0, 2.0, 2.0)) - - # Disable/Re-enable Mesh component due to ATOM-14299 - general.idle_wait(1.0) - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [blocker_entity.components[1]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', blocker_entity.components[1]) - if is_enabled: - print("Mesh component is still enabled") - else: - print("Mesh component was disabled") - editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [blocker_entity.components[1]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', blocker_entity.components[1]) - if is_enabled: - print("Mesh component is now enabled") - else: - print("Mesh component is still disabled") + components.TransformBus(bus.Event, "SetLocalUniformScale", blocker_entity.id, 2.0) # Verify spawned instance counts are accurate after addition of Blocker Entity num_expected = 160 # Number of "PurpleFlower"s that plant on a 10 x 10 surface minus 2m blocker cube diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py index ad57f80776..4a3edcd0e9 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/MeshBlocker_InstancesBlockedByMeshHeightTuning.py @@ -88,24 +88,9 @@ class test_MeshBlocker_InstancesBlockedByMeshHeightTuning(EditorTestHelper): bus.Broadcast, "GetAssetIdByPath", os.path.join("objects", "_primitives", "_box_1x1.azmodel"), math.Uuid(), False) blocker_entity.get_set_test(1, "Controller|Configuration|Mesh Asset", sphere_id) - components.TransformBus(bus.Event, "SetLocalScale", blocker_entity.id, math.Vector3(5.0, 5.0, 5.0)) + components.TransformBus(bus.Event, "SetLocalUniformScale", blocker_entity.id, 5.0) components.TransformBus(bus.Event, "SetLocalRotation", blocker_entity.id, math.Vector3(0.0, y_rotation, 0.0)) - # Disable/Re-enable Mesh component due to ATOM-14299 - general.idle_wait(1.0) - editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [blocker_entity.components[1]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', blocker_entity.components[1]) - if is_enabled: - print("Mesh component is still enabled") - else: - print("Mesh component was disabled") - editor.EditorComponentAPIBus(bus.Broadcast, 'EnableComponents', [blocker_entity.components[1]]) - is_enabled = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', blocker_entity.components[1]) - if is_enabled: - print("Mesh component is now enabled") - else: - print("Mesh component is still disabled") - # 5) Adjust the height Max percentage values of blocker blocker_entity.get_set_test(0, "Configuration|Mesh Height Percent Max", 0.8) From ceae858f099699db0a183707c9fa500a9ce06832 Mon Sep 17 00:00:00 2001 From: jckand-amzn Date: Fri, 9 Jul 2021 17:50:07 -0500 Subject: [PATCH 7/7] Updating to use of psutil directly Signed-off-by: jckand-amzn --- .../editor_python_test_tools/hydra_test_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py index 343eb5b12d..382a6f27f7 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/hydra_test_utils.py @@ -6,13 +6,13 @@ SPDX-License-Identifier: Apache-2.0 OR MIT import logging import os -import tempfile +import psutil import ly_test_tools.log.log_monitor import ly_test_tools.environment.process_utils as process_utils import ly_test_tools.environment.waiter as waiter -from ly_remote_console.remote_console_commands import RemoteConsole as RemoteConsole from ly_remote_console.remote_console_commands import send_command_and_expect_response as send_command_and_expect_response + logger = logging.getLogger(__name__) @@ -89,7 +89,7 @@ def launch_and_validate_results_launcher(launcher, level, remote_console_instanc :return: True if port is listening. """ port_listening = False - for conn in process_utils.psutil.net_connections(): + for conn in psutil.net_connections(): if 'port={}'.format(port) in str(conn): port_listening = True return port_listening