-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
lowAin't annoying anyone but the QA departmentAin't annoying anyone but the QA department
Description
Description
The ninja_with_exit_code fixture in tests/runner_tests.rs currently manipulates the global PATH environment variable to make a fake ninja executable available. This should be refactored to use the NINJA_ENV environment variable instead, mirroring the approach used in other test fixtures.
Context
This refactoring was suggested during the review of PR #89: #89 (comment)
Current Implementation
The fixture currently:
- Saves and modifies the PATH environment variable
- Prepends the fake ninja directory to PATH
- Returns a cleanup closure that restores the original PATH
Proposed Change
The fixture should instead:
- Use
NINJA_ENVto point directly to the fake ninja executable - Save and restore the original
NINJA_ENVvalue - Avoid PATH manipulation entirely
Benefits
- Cleaner test isolation (no global PATH modification)
- Consistency with other test fixtures in the codebase
- More predictable test behaviour
Implementation Notes
- The fixture is located at lines 34-56 in
tests/runner_tests.rs - Should follow the same pattern as the
run_respects_env_override_for_ninjatest - Maintain the same return tuple structure
(tempfile::TempDir, PathBuf, Cleanup)
Requested by: @leynos
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lowAin't annoying anyone but the QA departmentAin't annoying anyone but the QA department