Files
chenlin c32df70326
Checks / Layout, translation and Colab checks (push) Has been cancelled
Checks / Ruff (push) Has been cancelled
Checks / Framework tests (native backend, CPU) (push) Has been cancelled
Checks / Portable Rust controller (push) Has been cancelled
release: v0.1 generic robot training and application platform
2026-11-05 11:05:01 +08:00

25 lines
1000 B
Python

"""Template agent configs keep the log name and mutable values per run."""
import pytest
pytest.importorskip("mjlab")
from tasks import load_agent_cfg, load_runner_cls, registry
from tasks.robot_spec import scaffold_robot_spec
def test_onboarded_robot_gets_independent_agent_configs(neutral_robot, tmp_path, monkeypatch):
from mjrl.tasks.runner import CurriculumRunner
monkeypatch.setattr(registry, "_REGISTRY", {})
scaffold_robot_spec(neutral_robot, tasks_root=tmp_path)
registry.discover_robots(tmp_path)
first = load_agent_cfg(neutral_robot.robot_id)
first.actor.distribution_cfg["init_std"] = 99.0
first.algorithm.learning_rate = 99.0
next_run = load_agent_cfg(neutral_robot.robot_id)
assert next_run.actor.distribution_cfg["init_std"] != 99.0
assert next_run.algorithm.learning_rate != 99.0
assert first.experiment_name == next_run.experiment_name == neutral_robot.robot_id
assert load_runner_cls(neutral_robot.robot_id) is CurriculumRunner