test(capture): cover launch-env helpers and add EnvironmentModification mock#255
test(capture): cover launch-env helpers and add EnvironmentModification mock#255BANANASJIM wants to merge 1 commit into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughAdds ChangesEnvironment Modification Mock and Tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/test_capture_core.py (1)
551-572: 💤 Low valueOptional: Consider asserting the value of
ENABLE_VULKAN_RENDERDOC_CAPTURE.The test validates the presence and value of
VK_IMPLICIT_LAYER_PATH, but does not check thatENABLE_VULKAN_RENDERDOC_CAPTUREhas the value"1". Adding this assertion would provide slightly more thorough coverage.✨ Optional enhancement
vk_mod = next(m for m in mods if m.name == "VK_IMPLICIT_LAYER_PATH") assert vk_mod.value == str(tmp_path.resolve()) +enable_mod = next(m for m in mods if m.name == "ENABLE_VULKAN_RENDERDOC_CAPTURE") +assert enable_mod.value == "1"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/test_capture_core.py` around lines 551 - 572, In the test_win32_with_renderdoc_json_returns_two_mods test method, add an assertion to validate the value of the ENABLE_VULKAN_RENDERDOC_CAPTURE environment modification. After the existing assertion for the vk_mod variable (which checks VK_IMPLICIT_LAYER_PATH), use a similar pattern to retrieve the modification with name ENABLE_VULKAN_RENDERDOC_CAPTURE from the mods list and assert that its value equals "1" to ensure complete coverage of the modifications returned by _build_launch_env.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/test_capture_core.py`:
- Around line 551-572: In the test_win32_with_renderdoc_json_returns_two_mods
test method, add an assertion to validate the value of the
ENABLE_VULKAN_RENDERDOC_CAPTURE environment modification. After the existing
assertion for the vk_mod variable (which checks VK_IMPLICIT_LAYER_PATH), use a
similar pattern to retrieve the modification with name
ENABLE_VULKAN_RENDERDOC_CAPTURE from the mods list and assert that its value
equals "1" to ensure complete coverage of the modifications returned by
_build_launch_env.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 79c14726-499e-43bb-9be2-cf393d35cbce
📒 Files selected for processing (2)
tests/mocks/mock_renderdoc.pytests/unit/test_capture_core.py
Summary
Follow-up to #254. Adds unit coverage for the Windows launch-env helpers introduced there
(
_build_launch_env/_make_env_modinsrc/rdc/capture_core.py) and the mock symbols theyrequire. No production code is changed.
tests/mocks/mock_renderdoc.py: addEnvMod/EnvSepenums and theEnvironmentModificationdataclass (canonical RenderDoc surface) so the Windows path is exercisable under the mock.
tests/unit/test_capture_core.py: cover_make_env_mod(name/value/mod/sep) and all four_build_launch_envbranches — non-win32, missing__file__, missing siblingrenderdoc.json,and the happy path (asserts both
ENABLE_VULKAN_RENDERDOC_CAPTURE=1andVK_IMPLICIT_LAYER_PATHequal to the module directory). Adds oneexecute_and_capturewiringtest that the env list reaches
ExecuteAndInjecton win32 and is empty on other platforms.Why
#254 shipped with manual Windows smoke only; on Linux CI the helpers were almost entirely
uncovered (only the early non-win32 return). These tests close that gap.
Verification
pixi run lint: passpixi run test: 2999 passed, 6 skipped, 92.94% coverageNote
The GPU-gated mock-sync test (
tests/integration/test_mock_api_sync.py) is intentionally leftunchanged. Registering
EnvMod/EnvSep/EnvironmentModificationin its curated lists shouldbe verified against a real renderdoc module and can be a separate change.
Summary by CodeRabbit