"""Opt-in true PhysX integration; skips are NOT evidence of physical success.""" import json import os import subprocess import sys from pathlib import Path import pytest ROOT = Path(__file__).resolve().parents[1] pytestmark = pytest.mark.skipif(os.environ.get("CYCLE_RUNTIME_TESTS") != "1", reason="requires supervised Isaac PhysX") @pytest.mark.parametrize("script", [ "verify_wrench_physics.py", "verify_contact_cycle.py", "verify_cycle_learning_runtime.py", ]) def test_real_physics_contract(script, tmp_path): env = os.environ.copy() env.pop("CONDA_PREFIX", None) env.pop("VIRTUAL_ENV", None) env["PYTHONPATH"] = str(ROOT/"source/SkillFactory") lab = env.get("ISAACLAB_LAUNCHER", "/home/cen/IsaacLab/isaaclab.sh") process = subprocess.run([ sys.executable, str(ROOT/"scripts/supervise_sim.py"), "--log", str(tmp_path/"kit.log"), "--report", str(tmp_path/"process.json"), "--timeout", "240", "--", lab, "-p", str(ROOT/"scripts"/script), "--output", str(tmp_path/"trial"), "--headless", ], cwd=ROOT, env=env, capture_output=True, text=True, timeout=270) assert process.returncode == 0, process.stdout[-3000:] + process.stderr[-3000:] result = json.loads((tmp_path/"trial/result.json").read_text()) supervision = json.loads((tmp_path/"process.json").read_text()) assert result["passed"] and not result["accepted_skill"] assert supervision["passed"] and supervision["cleanup"]["clean"] assert not supervision["critical_log_lines"]