Skip to content

chore: prune redundant tests and remove legacy task-factory seam - #1573

Merged
TATP-233 merged 1 commit into
mainfrom
chore/issue-1572-prune-redundant-tests
Sep 14, 2026
Merged

TATP-233 merged 1 commit into
mainfrom
chore/issue-1572-prune-redundant-tests

Conversation

@TATP-233

@TATP-233 TATP-233 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Removed redundant tests identified by a full tests/ audit (7 parallel read-only audits, every candidate re-verified against src/ + git history before removal): old-interface guards (reward_config/domain_rand/control_config legacy-override loops, removed offpolicy option/kwarg guards, DrakeUniBatchBackend/A2JoystickCfg absence assertions, _selected_sim_backend/obs_profile markers), strict-duplicate coverage (g1 owner compose tests, motrix-sac/td3 compose tests, reward-injection integration, migration-matrix subset, APPO init-no-crash, observation finite-policy subset), tautological tests (former-script frozen-copy parity family, mock self-test, no-signal compile override, self-referential obs-alignment file), tests of third-party internals with zero unilab contact (unisim mjwarp private suites, body-state copy, MjSpec compile), and dead conftest fixtures (mp_ctx/tiny_storage/tiny_weight_shapes).
  • Removed the legacy task-factory seam src/unilab/tasks/compatibility.py (zero production users): deleted its test file and the closeout seam test, dropped the "compatibility" migration target, and rewrote the registry closeout so it enforces that legacy EnvCfg -> NpEnv factories cannot coexist with the canonical Manager-Based runtime.
  • Replaced the outdated private _RslRlVecEnvWrapper copy in test_rsl_rl_runner.py with the production uni_rl.algos.rsl_rl.RslRlVecEnvWrapper.
  • Updated 6 docs pages (en + zh_CN) that cited the deleted obs-alignment test to reference the real guarantee (ObservationManager per-term history buffers, tests/managers/test_observation_buffers_noise.py).
  • Unique assertions from deleted duplicates were folded into the superset suite (g1 owner contract now pins fragment_files/terrain/genesis_device_id/pd_gains is None for isaacgym/genesis owners).
  • No user-facing, training, backend, or runtime behavior change. 41 files, +44/−1867.

Linked Work

Validation

  • make test-all passed on the final local head before this PR was created or updated — partially blocked by a pre-existing local environment issue, see below
  • Additional task-specific validation listed below

Commands actually run (on final head 98df4068):

make check                  # PASS: ruff format/check, mypy 137 files, pyright 0 errors, tests lint
make test-all               # check PASS; test-cov ABORTED at collection: 7 files error with
                            # AttributeError: module 'mjbatch' has no attribute 'VariantPack'
make test-benchmark-smoke   # PASS: 34/35 (1 skipped, platform-optional mlx)

# Failure-set equivalence vs main (same command on both heads, sorted FAILED lists diffed):
uv run pytest -m "not slow" -q --continue-on-collection-errors \
  --ignore=tests/algos/test_appo_runner.py --ignore=tests/algos/test_rsl_rl_runner.py \
  --ignore=tests/base/backend/test_mujoco_scene_context_visual.py \
  --ignore=tests/base/test_sim_backend_set_state_timing.py \
  --ignore=tests/base/test_sim_backend_smoke.py \
  --ignore=tests/scripts/test_train_script_configs.py \
  --ignore=tests/training/test_training_helpers.py
# main: 40 failed / this head: 39 failed — diff shows the ONLY delta is the deleted
# tests/base/test_dr_legacy_removed.py (itself failing on main). Zero new failures.

uv run pytest tests/scripts/test_check_docs.py -q          # PASS: 19
cd docs/sphinx && UNILAB_DOCS_SKIP_AUTODOC=1 uv run --no-project \
  --with-requirements requirements.txt sphinx-build -b html -n source build/html   # PASS

The test-cov collection errors are a pre-existing local environment defect, not caused by this PR: the venv has mjbatch-uni 0.1.0 while pyproject.toml requires ~=0.2.0, so every file that imports unisim.backend.mujoco.backend fails identically on main (verified via git stash baseline: same 7 collection errors, same 39+1 runtime failures). A clean CI environment is the real gate for those files.

Remote CI route:

Impact

  • Backend impact: none
  • Platform impact: Linux (validated); no platform-specific behavior touched
  • Training effect expected: no

Artifacts

  • W&B: n/a
  • benchmark result: make test-benchmark-smoke 34/35 (1 platform-optional skip)
  • video / screenshot: n/a
  • ONNX / checkpoint: n/a

Checklist

  • Added or updated tests where needed (registry closeout rewritten; g1 owner contract strengthened)
  • Updated docs if behavior or workflow changed (6 pages, en + zh_CN)
  • Linked the driving issue (chore: prune redundant defensive tests and remove the legacy task-factory seam #1572)
  • Noted any follow-up work explicitly:
    • Local env needs mjbatch-uni ~=0.2.0 (reinstall/rebuild) for the mujoco-backend test files; affects main equally.
    • Kept deliberately: skip-gated drake_uni acceptance tests (zero CI cost, only acceptance signal when the optional extension is installed) and the registry's legacy reward_config routing tests (live code for external plugin packages).

Remove defensive tests whose guarded old interfaces no longer exist,
strict-duplicate coverage, tautological/mock-only tests, tests of
third-party private internals, and dead fixtures identified by a
full tests/ audit (#1572).

- delete 9 test files; surgically prune redundant tests/assertions in
  22 files, folding unique assertions into the g1 owner contract suite
- remove src/unilab/tasks/compatibility.py and its seam: the registry
  closeout now enforces that legacy EnvCfg -> NpEnv factories cannot
  coexist with the canonical Manager-Based runtime
- replace the outdated private _RslRlVecEnvWrapper copy with the
  production uni_rl wrapper
- update 6 docs pages (en/zh_CN) that cited the deleted obs-alignment
  test to reference ObservationManager history buffers instead

Issue: #1572
@TATP-233
TATP-233 merged commit e78e440 into main Sep 14, 2026
8 checks passed
@TATP-233
TATP-233 deleted the chore/issue-1572-prune-redundant-tests branch September 14, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant