Open Notgnoshi opened 5 days ago
cargo-mutants
seems to not let you run --ignored
tests, so there's a bunch of hits that should be excluded
rg -l '#\[ignore' | xargs sed -Ei 's|#\[ignore|// #[ignore|'
This adds quite a bit of time to each test, but it resolves #64 well enough that cargo-mutants
can run the integration tests
diff --git a/herostratus-tests/src/cmd.rs b/herostratus-tests/src/cmd.rs
index d96ce29..1a822e0 100644
--- a/herostratus-tests/src/cmd.rs
+++ b/herostratus-tests/src/cmd.rs
@@ -18,6 +18,14 @@ pub fn herostratus(data_dir: Option<&Path>) -> (Command, Option<TempDir>) {
(Some(temp), data_dir)
};
+ // This will slow down the integration tests
+ Command::new("cargo")
+ .arg("build")
+ .arg("-p")
+ .arg("herostratus")
+ .output()
+ .expect("Failed to build Herostratus");
+
let mut cmd = Command::new(&*HEROSTRATUS);
cmd.arg("--log-level=DEBUG").arg("--data-dir").arg(path);
Without integration tests
With integration tests
cargo mutants --in-place --package herostratus --test-workspace true
So it appears that the integration tests do indeed improve test coverage! (expected result ...)
--in-place
is necessary because the tests operate on Herostratus itself as a Git repository, and use paths relative to the test CWD to do so.