Normally, cargo-mutants builds and runs your tree in a temporary directory before applying any mutations. This makes sure that your tests are in fact all passing, including in the copy of the tree that cargo-mutants will mutate.
Baseline tests can be skipped by passing the
--baseline=skip command line option. (There is no config option for this.)
--baseline=skip, you must make sure that the tests are actually passing, otherwise the results of cargo-mutants will be meaningless. cargo-mutants will probably report that all or most mutations were caught, but the test failures were not because of the mutations.
The performance gain from skipping the baseline is one run of the full test suite, plus one incremental build. When the baseline is run, its build is typically slow because it must do the initial build of the tree, but when it is skipped, the first mutant will have to do a full (rather than incremental) build instead.
This means that, in a run that tests many mutants, the relative performance gain from skipping the baseline will be relatively small. However, it may still be useful to skip baseline tests in some specific situations.
Normally, cargo-mutants uses the baseline test to establish an appropriate
timeout for the test suite. If you skip the baseline, you should set
--baseline=skip might be useful in these situations:
You are running cargo-mutants in a CI or build system that separately runs the tests before cargo-mutants. In this case, you can be confident that the tests are passing, and you can save time by skipping the baseline. In particular, if you are sharding work in CI, this avoids running the baseline on each shard.
You're repeatedly running
cargo-mutantswith different options, without changing the source code, perhaps with different
cargo-mutantsitself, and running it repeatedly on a tree that doesn't change.