Merge pull request #2305 from aws-lumberyard-dev/jckand/DynVegXfailFixes

Updating skipped/xfailed Dynamic Vegetation automated tests
monroegm-disable-blank-issue-2
Terry Michaels 5 years ago committed by GitHub
commit e21ef0fbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -82,22 +82,7 @@ class TestPositionModifierAutoSnapToSurface(EditorTestHelper):
# 3) Create a spherical planting surface and a flat surface
flat_entity = dynveg.create_surface_entity("Flat Surface", spawner_center_point, 32.0, 32.0, 1.0)
hill_entity = dynveg.create_mesh_surface_entity_with_slopes("Planting Surface", spawner_center_point, 5.0, 5.0, 5.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("Planting Surface", spawner_center_point, 5.0)
# Disable the Flat Surface Box Shape component, and temporarily ignore initial instance counts due to LYN-2245
editor.EditorComponentAPIBus(bus.Broadcast, 'DisableComponents', [flat_entity.components[0]])
@ -117,14 +102,14 @@ class TestPositionModifierAutoSnapToSurface(EditorTestHelper):
# Pin the Constant Gradient to the X axis of the spawner's Position Modifier component
spawner_entity.get_set_test(3, 'Configuration|Position X|Gradient|Gradient Entity Id', gradient_entity.id)
# 6) Set the Position Modifier offset to 5 on the x-axis
spawner_entity.get_set_test(3, position_modifier_paths[0], 5)
spawner_entity.get_set_test(3, position_modifier_paths[1], 5)
# 6) Set the Position Modifier offset to 2.5 on the x-axis
spawner_entity.get_set_test(3, position_modifier_paths[0], 2.5)
spawner_entity.get_set_test(3, position_modifier_paths[1], 2.5)
# 7) Validate instance count at the top of the sphere mesh and inside the sphere mesh while Auto Snap to Surface
# is enabled
top_point = math.Vector3(512.0, 512.0, 37.0)
inside_point = math.Vector3(512.0, 512.0, 33.0)
inside_point = math.Vector3(512.0, 512.0, 35.0)
radius = 0.5
num_expected = 1
self.log(f"Checking for instances in a {radius * 2}m area at {top_point.ToString()}")

@ -53,17 +53,19 @@ class TestSlopeAlignmentModifierOverrides(EditorTestHelper):
use_terrain=False,
)
general.set_current_view_position(512.0, 480.0, 38.0)
# Create a spawner entity setup with all needed components
center_point = math.Vector3(512.0, 512.0, 32.0)
asset_path = os.path.join("Slices", "PinkFlower.dynamicslice")
spawner_entity = dynveg.create_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path)
# Create a sloped mesh surface for the instances to plant on
center_point = math.Vector3(502.0, 512.0, 24.0)
mesh_asset_path = os.path.join("objects", "_primitives", "_box_1x1.azmodel")
mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(),
False)
rotation = math.Vector3(0.0, radians(45.0), 0.0)
scale = math.Vector3(10.0, 10.0, 10.0)
surface_entity = hydra.Entity("Surface Entity")
surface_entity.create_entity(
center_point,
@ -73,7 +75,7 @@ class TestSlopeAlignmentModifierOverrides(EditorTestHelper):
print(f"'{surface_entity.name}' created")
hydra.get_set_test(surface_entity, 0, "Controller|Configuration|Mesh Asset", mesh_asset)
components.TransformBus(bus.Event, "SetLocalRotation", surface_entity.id, rotation)
components.TransformBus(bus.Event, "SetLocalScale", surface_entity.id, scale)
components.TransformBus(bus.Event, "SetLocalUniformScale", surface_entity.id, 30.0)
# Add a Vegetation Debugger component to allow refreshing instances
hydra.add_level_component("Vegetation Debugger")

@ -62,11 +62,11 @@ class TestSlopeAlignmentModifier(EditorTestHelper):
spawner_entity = dynveg.create_vegetation_area("Instance Spawner", center_point, 16.0, 16.0, 32.0, asset_path)
# Create a sloped mesh surface for the instances to plant on
center_point = math.Vector3(502.0, 512.0, 24.0)
mesh_asset_path = os.path.join("objects", "_primitives", "_box_1x1.azmodel")
mesh_asset = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", mesh_asset_path, math.Uuid(),
False)
rotation = math.Vector3(0.0, radians(45.0), 0.0)
scale = math.Vector3(10.0, 10.0, 10.0)
surface_entity = hydra.Entity("Surface Entity")
surface_entity.create_entity(
center_point,
@ -76,7 +76,7 @@ class TestSlopeAlignmentModifier(EditorTestHelper):
print(f"'{surface_entity.name}' created")
hydra.get_set_test(surface_entity, 0, "Controller|Configuration|Mesh Asset", mesh_asset)
components.TransformBus(bus.Event, "SetLocalRotation", surface_entity.id, rotation)
components.TransformBus(bus.Event, "SetLocalScale", surface_entity.id, scale)
components.TransformBus(bus.Event, "SetLocalUniformScale", surface_entity.id, 30.0)
# Add a Vegetation Debugger component to allow refreshing instances
hydra.add_level_component("Vegetation Debugger")

@ -81,7 +81,7 @@ class TestSlopeFilterComponentAndOverrides(EditorTestHelper):
# 3) Add surfaces to plant on. This will include a flat surface and a sphere mesh to provide a sloped surface
dynveg.create_surface_entity("Planting Surface", center_point, 32.0, 32.0, 1.0)
sloped_surface_center = math.Vector3(512.0, 512.0, 38.0)
dynveg.create_mesh_surface_entity_with_slopes("Sloped Planting Surface", sloped_surface_center, 5.0, 5.0, 5.0)
dynveg.create_mesh_surface_entity_with_slopes("Sloped Planting Surface", sloped_surface_center, 10.0)
# Set instances to spawn on a center snap point to avoid unexpected instances around the edges of the box shape
veg_system_settings_component = hydra.add_level_component("Vegetation System Settings")
@ -101,7 +101,7 @@ class TestSlopeFilterComponentAndOverrides(EditorTestHelper):
spawner_entity.get_set_test(3, "Configuration|Slope Max", 45)
# 6) Validate instance counts post-filter: instances should only plant on slopes between 20-45 degrees
num_expected_slopes_post_filter = 44
num_expected_slopes_post_filter = 48
slope_min_max_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(
spawner_entity.id, num_expected_slopes_post_filter), 5.0)
self.test_success = slope_min_max_success and self.test_success
@ -115,7 +115,7 @@ class TestSlopeFilterComponentAndOverrides(EditorTestHelper):
spawner_entity.get_set_test(2, "Configuration|Embedded Assets|[0]|Slope Filter|Max", 20)
# 9) Validate instance counts post-filter: instances should only plant on slopes between 5-20 degrees
num_expected_slopes_post_filter_overrides = 16
num_expected_slopes_post_filter_overrides = 12
overrides_min_max_success = self.wait_for_condition(lambda: dynveg.validate_instance_count_in_entity_shape(
spawner_entity.id, num_expected_slopes_post_filter_overrides), 5.0)
self.test_success = overrides_min_max_success and self.test_success

@ -84,7 +84,7 @@ class TestAltitudeFilter(object):
@pytest.mark.test_case_id("C4847478")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_filter
@pytest.mark.xfail # LYN-3275
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_AltitudeFilter_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
cfg_args = [level]

@ -100,7 +100,7 @@ class TestLayerSpawner(object):
@pytest.mark.test_case_id("C4765973")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_misc
@pytest.mark.xfail # LYN-3275
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_LayerSpawner_FilterStageToggle(self, request, editor, level, workspace, launcher_platform):
expected_lines = [

@ -56,9 +56,9 @@ class TestPositionModifier(object):
)
@pytest.mark.test_case_id("C4874100")
@pytest.mark.SUITE_sandbox
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_modifier
@pytest.mark.xfail # LYN-3275
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_PositionModifier_AutoSnapToSurfaceWorks(self, request, editor, level, launcher_platform):
expected_lines = [

@ -38,7 +38,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4896941")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_SlopeAlignmentModifier_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
expected_lines = [
@ -61,7 +61,7 @@ class TestSlopeAlignmentModifier(object):
@pytest.mark.test_case_id("C4814459")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_modifier
@pytest.mark.skip # ATOM-14299
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_SlopeAlignmentModifierOverrides_InstanceSurfaceAlignment(self, request, editor, level, launcher_platform):
expected_lines = [

@ -68,7 +68,7 @@ class TestSlopeFilter(object):
@pytest.mark.test_case_id("C4814464", "C4874096")
@pytest.mark.SUITE_periodic
@pytest.mark.dynveg_filter
@pytest.mark.skip # LYN-2211
@pytest.mark.xfail(reason="https://github.com/o3de/o3de/issues/2303")
def test_SlopeFilter_ComponentAndOverrides_InstancesPlantOnValidSlopes(self, request, editor, level,
launcher_platform):
@ -79,10 +79,10 @@ class TestSlopeFilter(object):
"instance count validation: True (found=1720, expected=1720)",
"Instance Spawner Configuration|Slope Min: SUCCESS",
"Instance Spawner Configuration|Slope Max: SUCCESS",
"instance count validation: True (found=44, expected=44)",
"instance count validation: True (found=48, expected=48)",
"Instance Spawner Configuration|Embedded Assets|[0]|Slope Filter|Min: SUCCESS",
"Instance Spawner Configuration|Embedded Assets|[0]|Slope Filter|Max: SUCCESS",
"instance count validation: True (found=16, expected=16)",
"instance count validation: True (found=12, expected=12)",
"SlopeFilter_InstancesPlantOnValidSlope: result=SUCCESS"
]

Loading…
Cancel
Save