Skip to content

Commit 0201086

Browse files
Migrate source/isaaclab/test/sim to launch_kit()
Replace the module-scope AppLauncher construction in the Kit-dependent files under source/isaaclab/test/sim with launch_kit(), and declare the matching kit or kit_cameras marker on each file. Because launch_kit() is idempotent, a pytest process covering several of these files now boots Kit once instead of once per file. Nothing forces them into one process yet -- tools/conftest.py still runs a subprocess per file -- so this changes how the files launch Kit, not how CI schedules them. 24 files map to `kit` and 4 to `kit_cameras`. The two groups must not share a process in that order: a camera-enabled app can serve tests that do not need cameras, but cameras cannot be enabled after startup, so launch_kit() raises rather than handing back an app that would silently fail to render. The transform is applied by tools/codemods/kit_launch_migration.py, added here because ~125 files in other packages remain to migrate. It edits line ranges in place rather than round-tripping through ast.unparse, which would discard comments and isort directives, and it preserves each launch call's position so the Kit-dependent imports below it still run after Kit starts. The codemod refuses anything it cannot rewrite without changing behaviour, and reports it. In particular it rejects a conditional launch such as `AppLauncher(...).app if _USE_KIT else None`, which test_mjcf_converter.py and test_urdf_converter.py use so they can run kitlessly when the standalone importer wheel is installed; collapsing that ternary would have made the boot unconditional. It also refuses a file that references AppLauncher for anything other than the launch call, since the import is removed.
1 parent d3a9c15 commit 0201086

30 files changed

Lines changed: 415 additions & 234 deletions

source/isaaclab/test/sim/test_articulation_fragments.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import os
1611

@@ -21,6 +16,8 @@
2116
import isaaclab.sim as sim_utils
2217
from isaaclab.sim import SimulationCfg, SimulationContext
2318

19+
pytestmark = pytest.mark.kit
20+
2421

2522
def _make_xform(stage, path="/World/Art"):
2623
UsdGeom.Xform.Define(stage, path)

source/isaaclab/test/sim/test_build_simulation_context_headless.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,16 @@
1313
``test_build_simulation_context_nonheadless.py``.
1414
"""
1515

16-
"""Launch Isaac Sim Simulator first."""
16+
from isaaclab.test.launch import launch_kit
1717

18-
from isaaclab.app import AppLauncher
19-
20-
# launch omniverse app
21-
simulation_app = AppLauncher(headless=True).app
22-
23-
"""Rest everything follows."""
18+
launch_kit()
2419

2520
import pytest
2621

2722
from isaaclab.sim.simulation_cfg import SimulationCfg
2823
from isaaclab.sim.simulation_context import build_simulation_context
2924

30-
pytestmark = pytest.mark.integration
25+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
3126

3227

3328
@pytest.mark.parametrize("gravity_enabled", [True, False])

source/isaaclab/test/sim/test_build_simulation_context_nonheadless.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,16 @@
1212
``test_build_simulation_context_headless.py``.
1313
"""
1414

15-
"""Launch Isaac Sim Simulator first."""
15+
from isaaclab.test.launch import launch_kit
1616

17-
from isaaclab.app import AppLauncher
18-
19-
# launch omniverse app
20-
simulation_app = AppLauncher(headless=True).app
21-
22-
"""Rest everything follows."""
17+
launch_kit()
2318

2419
import pytest
2520

2621
from isaaclab.sim.simulation_cfg import SimulationCfg
2722
from isaaclab.sim.simulation_context import build_simulation_context
2823

29-
pytestmark = pytest.mark.integration
24+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
3025

3126

3227
@pytest.mark.parametrize("gravity_enabled", [True, False])

source/isaaclab/test/sim/test_cloner.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@
55

66
"""Tests for USD cloner utilities (no PhysX dependency)."""
77

8-
"""Launch Isaac Sim Simulator first."""
8+
from isaaclab.test.launch import launch_kit
99

10-
from isaaclab.app import AppLauncher
11-
12-
# launch omniverse app
13-
simulation_app = AppLauncher(headless=True).app
14-
15-
"""Rest everything follows."""
10+
launch_kit()
1611

1712
from types import SimpleNamespace
1813
from unittest.mock import MagicMock
@@ -37,7 +32,7 @@
3732
)
3833
from isaaclab.sim import build_simulation_context
3934

40-
pytestmark = [pytest.mark.integration, pytest.mark.isaacsim_ci]
35+
pytestmark = [pytest.mark.kit, pytest.mark.integration, pytest.mark.isaacsim_ci]
4136

4237

4338
@pytest.fixture(params=["cpu", "cuda"])

source/isaaclab/test/sim/test_collision_fragments.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import pytest
1611

@@ -19,7 +14,7 @@
1914
import isaaclab.sim as sim_utils
2015
from isaaclab.sim import SimulationCfg, SimulationContext
2116

22-
pytestmark = pytest.mark.integration
17+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
2318

2419

2520
def _make_xform(stage, path="/World/Body"):

source/isaaclab/test/sim/test_joint_drive_fragments.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import math
1611

@@ -21,7 +16,7 @@
2116
import isaaclab.sim as sim_utils
2217
from isaaclab.sim import SimulationCfg, SimulationContext
2318

24-
pytestmark = pytest.mark.integration
19+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
2520

2621

2722
def _make_revolute_joint(stage, path="/World/Articulation/joint_0"):

source/isaaclab/test/sim/test_mass_fragments.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import pytest
1611

@@ -19,7 +14,7 @@
1914
import isaaclab.sim as sim_utils
2015
from isaaclab.sim import SimulationCfg, SimulationContext
2116

22-
pytestmark = pytest.mark.integration
17+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
2318

2419

2520
def _make_xform(stage, path="/World/Body"):

source/isaaclab/test/sim/test_material_fragments.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import pytest
1611

@@ -19,7 +14,7 @@
1914
import isaaclab.sim as sim_utils
2015
from isaaclab.sim import SimulationCfg, SimulationContext
2116

22-
pytestmark = pytest.mark.integration
17+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
2318

2419
# -------------------------------------------------------------------------------------
2520
# RigidBodyMaterialFragment marker + metadata

source/isaaclab/test/sim/test_mesh_collision_fragments.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import pytest
1611

@@ -19,7 +14,7 @@
1914
import isaaclab.sim as sim_utils
2015
from isaaclab.sim import SimulationCfg, SimulationContext
2116

22-
pytestmark = pytest.mark.integration
17+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
2318

2419

2520
def _make_xform(stage, path="/World/Mesh"):

source/isaaclab/test/sim/test_mesh_converter.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@
33
#
44
# SPDX-License-Identifier: BSD-3-Clause
55

6-
"""Launch Isaac Sim Simulator first."""
6+
from isaaclab.test.launch import launch_kit
77

8-
from isaaclab.app import AppLauncher
9-
10-
# launch omniverse app
11-
simulation_app = AppLauncher(headless=True).app
12-
13-
"""Rest everything follows."""
8+
launch_kit()
149

1510
import math
1611
import os
@@ -27,7 +22,7 @@
2722
from isaaclab.sim.schemas import MESH_APPROXIMATION_TOKENS, schemas_cfg
2823
from isaaclab.utils.assets import ISAACLAB_NUCLEUS_DIR, retrieve_file_path
2924

30-
pytestmark = pytest.mark.integration
25+
pytestmark = [pytest.mark.kit, pytest.mark.integration]
3126

3227

3328
def random_quaternion():

0 commit comments

Comments
 (0)