Split observation-space unit and integration tests#6633
Conversation
Keep Gym space construction simulator-free while preserving the task-backed CPU/CUDA reset, camera, and ray-caster integration paths.
Greptile SummaryThis PR splits the existing
Confidence Score: 4/5This is a test-only refactor with no production code changes; the split is clean and the stub-based unit tests correctly reflect the actual The unit-test rewrite loses the insertion-order assertion that was the original guard for issue #3133 (using Both test files are worth a quick read; the integration file carries a pre-existing function-name typo, and the unit file's membership-only assertion for Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Original test file\ntest_manager_based_rl_env_obs_spaces.py] -->|split into| B[Unit test\ntest_manager_based_rl_env_obs_spaces.py]
A -->|extracted to| C[Integration test\ntest_manager_based_rl_env_obs_spaces_task_integration.py]
B --> D[object.__new__ + SimpleNamespace stubs\nNo simulator required]
D --> E[_configure_gym_env_spaces\ncalled directly]
E --> F[2 unit tests\npytest.mark.unit]
C --> G[AppLauncher + isaaclab_tasks\nSimulator required]
G --> H[ManagerBasedRLEnv init\nfull lifecycle]
H --> I[8 integration tests\npytest.mark.integration\ncpu x cuda x RGB/Depth/RayCaster]
style B fill:#d4edda
style C fill:#fff3cd
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Original test file\ntest_manager_based_rl_env_obs_spaces.py] -->|split into| B[Unit test\ntest_manager_based_rl_env_obs_spaces.py]
A -->|extracted to| C[Integration test\ntest_manager_based_rl_env_obs_spaces_task_integration.py]
B --> D[object.__new__ + SimpleNamespace stubs\nNo simulator required]
D --> E[_configure_gym_env_spaces\ncalled directly]
E --> F[2 unit tests\npytest.mark.unit]
C --> G[AppLauncher + isaaclab_tasks\nSimulator required]
G --> H[ManagerBasedRLEnv init\nfull lifecycle]
H --> I[8 integration tests\npytest.mark.integration\ncpu x cuda x RGB/Depth/RayCaster]
style B fill:#d4edda
style C fill:#fff3cd
Reviews (1): Last reviewed commit: "test: Split observation-space coverage" | Re-trigger Greptile |
| ids=["RGB", "Depth", "RayCaster"], | ||
| ) | ||
| @pytest.mark.parametrize("device", ["cpu", "cuda"]) | ||
| def test_obs_space_follows_clip_contraint(env_cfg_cls, presets, device): |
There was a problem hiding this comment.
The function name preserves the pre-existing typo
contraint instead of constraint. Since the unit-test counterpart (test_obs_space_follows_clip_constraint) already spells this correctly, fixing the integration test name now would keep both files consistent and avoid the typo persisting into whatever final home these tests land in.
| def test_obs_space_follows_clip_contraint(env_cfg_cls, presets, device): | |
| def test_obs_space_follows_clip_constraint(env_cfg_cls, presets, device): |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| """Non-concatenated observation groups expose every term in the Dict space (issue #3133). | ||
|
|
||
| Before the fix, only the last term in each non-concatenated group would be present |
There was a problem hiding this comment.
Ordering assertion silently dropped
The original test used list(policy_space.spaces) == expected_policy_terms to verify both membership and insertion order, which was meaningful because the original bug (issue #3133) caused only the last term to survive. The new unit test replaces this with a set comparison, so a future regression where terms appear in the wrong order would go undetected. Switching to an ordered check — even with synthetic term names — would keep the full regression guard intact.
Restore ordered term coverage, correct the integration test name, and explain why the test-only change skips a package version bump.
Use a general kitless unit-test home that can accommodate future ManagerBasedRLEnv coverage while keeping the integration timeout explicit.
Description
Split manager-based RL observation-space construction from task-backed lifecycle coverage:
_configure_gym_env_spacesas a simulator-free unit contract with synthetic vector, matrix, and image termsisaaclab_tasksimport required for task registrationThis is PR3 of the focused replacement series for #6526.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there