Skip to content

Commit 237d2f3

Browse files
committed
Restrict core smoke tests to supported backends
1 parent ca111ab commit 237d2f3

1 file changed

Lines changed: 32 additions & 8 deletions

File tree

source/isaaclab_tasks/test/core/test_environments.py

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,45 @@
1616

1717
import pytest
1818

19+
from isaaclab.physics import PhysicsCfg
20+
1921
import isaaclab_tasks # noqa: F401
22+
from isaaclab_tasks.utils.hydra import collect_presets
23+
from isaaclab_tasks.utils.parse_cfg import load_cfg_from_registry
2024

2125
# Local imports should be imported last
2226
from env_test_utils import _run_environments, setup_environment # isort: skip
2327

2428

25-
@pytest.mark.parametrize("physics_preset_name", ["newton_mjwarp", "physx", "isaacsim_physx"])
29+
_PHYSICS_PRESET_NAMES = ("newton_mjwarp", "physx", "isaacsim_physx")
30+
31+
32+
def _core_physics_params() -> list:
33+
"""Return core task/backend pairs for explicitly supported physics presets."""
34+
params = []
35+
for task_param in setup_environment(multi_agent=False, tier="core"):
36+
task_name = getattr(task_param, "values", (task_param,))[0]
37+
marks = getattr(task_param, "marks", ())
38+
env_cfg = load_cfg_from_registry(task_name, "env_cfg_entry_point")
39+
physics_preset_groups = collect_presets(env_cfg).values()
40+
for physics_preset_name in _PHYSICS_PRESET_NAMES:
41+
if any(
42+
physics_preset_name in preset_group and isinstance(preset_group[physics_preset_name], PhysicsCfg)
43+
for preset_group in physics_preset_groups
44+
):
45+
params.append(
46+
pytest.param(
47+
task_name,
48+
physics_preset_name,
49+
id=f"{task_name}-{physics_preset_name}",
50+
marks=marks,
51+
)
52+
)
53+
return params
54+
55+
56+
@pytest.mark.parametrize("task_name, physics_preset_name", _core_physics_params())
2657
@pytest.mark.parametrize("num_envs, device", [(2, "cuda"), (1, "cuda")])
27-
@pytest.mark.parametrize(
28-
"task_name",
29-
setup_environment(
30-
multi_agent=False,
31-
tier="core",
32-
),
33-
)
3458
@pytest.mark.isaacsim_ci
3559
def test_environments(task_name, physics_preset_name, num_envs, device):
3660
# run environments without stage in memory

0 commit comments

Comments
 (0)