Description
This issue tracks test improvements identified during the review of PR #89.
Tasks
Context
The tests currently use #[serial] to prevent race conditions when modifying the global PATH environment variable. By using NINJA_ENV within fixtures to specify the ninja binary location, tests can run in parallel safely.
Affected tests in tests/runner_tests.rs:
run_executes_ninja_without_persisting_file
run_build_with_emit_keeps_file
run_build_with_emit_creates_parent_dirs
References
Benefits
- Faster test execution through parallelisation
- Cleaner test code without unnecessary drops
- Better test isolation
Description
This issue tracks test improvements identified during the review of PR #89.
Tasks
drop(ninja_path)calls in tests as PathBuf doesn't own external resources#[serial]attributes from tests to enable parallel executionNINJA_ENVinstead of modifying PATHContext
The tests currently use
#[serial]to prevent race conditions when modifying the global PATH environment variable. By usingNINJA_ENVwithin fixtures to specify the ninja binary location, tests can run in parallel safely.Affected tests in
tests/runner_tests.rs:run_executes_ninja_without_persisting_filerun_build_with_emit_keeps_filerun_build_with_emit_creates_parent_dirsReferences
Benefits