Skip to content

Remove no-op drops and enable parallel test execution by isolating environment #97

@coderabbitai

Description

@coderabbitai

Description

This issue tracks test improvements identified during the review of PR #89.

Tasks

  • Remove explicit drop(ninja_path) calls in tests as PathBuf doesn't own external resources
  • Remove #[serial] attributes from tests to enable parallel execution
  • Modify test fixtures to isolate environment using NINJA_ENV instead of modifying PATH

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

Metadata

Metadata

Assignees

Labels

mediumCould be disruptive, but might not happen

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions