cargo-mutants icon indicating copy to clipboard operation
cargo-mutants copied to clipboard

Test in-place rather than copying to a tmpdir

Open sourcefrog opened this issue 2 years ago • 0 comments

Currently, cargo-mutants copies the whole tree (excluding target/) to a temp dir before testing.

We could add an option to test in place.

This has some advantages:

  • If the tree has any up-to-date build artifacts they could be used
  • Avoids the time to copy the tree, which might be significant on very large trees.
  • Uses less tmpdir space, file IO, etc.

And, some drawbacks:

  • You can't keep editing or doing other work in the tree while mutants is running, of course, so you might not want this on a workstation. But it might be fine in CI.
  • If mutants is abruptly interrupted (e.g. by SIGKILL or a gap in ctrlc handling) it might leave mutated files behind when it exits which is, again, not great if the source is a tree in which you're working.

For parallel -j we would still need n-1 copies.

Overall it seems like not a good default but a reasonable option.

sourcefrog avatar Oct 04 '23 15:10 sourcefrog