-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experiment with mutation testing #63
Comments
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 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 ...) |
Merged
Notgnoshi
added a commit
that referenced
this issue
Nov 30, 2024
Notgnoshi
added a commit
that referenced
this issue
Dec 30, 2024
Mutation testing revealed a few gaps that I thought were worth filling in, and in doing so, it importantly highlighted a bug in herostratus::git::pull_branch. This alone makes it worth it! Closes #63
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--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.The text was updated successfully, but these errors were encountered: