Skip to content
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

Fix missing test coverage found by cargo-mutants #457

Closed
7 of 43 tasks
djmitche opened this issue Sep 19, 2024 · 1 comment
Closed
7 of 43 tasks

Fix missing test coverage found by cargo-mutants #457

djmitche opened this issue Sep 19, 2024 · 1 comment
Assignees

Comments

@djmitche
Copy link
Collaborator

djmitche commented Sep 19, 2024

I heard about cargo-mutants a RustConf 2024, and thought I'd give it a go. It ran for about 2h and found the following. Maybe this is nonsense, but worth a look. It would run faster if I could convince it to only run the lib tests and not the integration tests.

  • taskchampion/src/server/cloud/gcp.rs:131:23: replace > with == in ::compare_and_swap in 5.5s build + 24.1s test
  • taskchampion/src/taskdb/snapshot.rs:31:9: replace ::expecting -> fmt::Result with Ok(Default::default()) in 5.6s build + 24.5s test
  • taskchampion/src/storage/mod.rs:137:23: replace && with || in StorageTxn::is_empty in 5.2s build + 24.5s test
  • taskchampion/src/server/cloud/gcp.rs:211:36: replace < with == in <impl Iterator for ObjectIterator<'a>>::next in 5.2s build + 24.8s test
  • taskchampion/src/replica.rs:420:9: replace Replica::add_undo_point -> Result<()> with Ok(()) in 5.6s build + 32.2s test
  • taskchampion/src/task/task.rs:244:9: replace Task::get_legacy_udas -> impl Iterator<Item =(&str, &str)>+'_ with ::std::iter::once(("xyzzy", "xyzzy")) in 5.4s build + 25.1s test
  • taskchampion/src/task/task.rs:252:9: replace Task::get_modified -> Option with Some(Default::default()) in 5.3s build + 24.9s test
  • taskchampion/src/server/sync/mod.rs:168:9: replace ::add_snapshot -> Result<()> with Ok(()) in 5.3s build + 29.0s test
  • taskchampion/src/taskdb/sync.rs:121:46: replace == with != in sync in 5.2s build + 24.1s test
  • taskchampion/src/server/cloud/gcp.rs:21:70: replace == with != in is_http_error in 5.2s build + 24.6s test
  • taskchampion/src/task/tag.rs:28:9: replace Tag::is_synthetic -> bool with false in 5.3s build + 24.3s test
  • taskchampion/src/task/task.rs:244:9: replace Task::get_legacy_udas -> impl Iterator<Item =(&str, &str)>+'_ with ::std::iter::once(("xyzzy", "")) in 8.7s build + 29.2s test
  • taskchampion/src/storage/mod.rs:135:23: replace && with || in StorageTxn::is_empty in 4.7s build + 24.5s test
  • taskchampion/src/server/sync/mod.rs:85:36: replace == with != in sealed_from_resp in 5.1s build + 24.3s test
  • taskchampion/src/server/cloud/gcp.rs:88:12: delete ! in ::del in 4.5s build + 24.2s test
  • taskchampion/src/storage/mod.rs:133:9: replace StorageTxn::is_empty -> Result with Ok(true) in 5.5s build + 24.1s test
  • taskchampion/src/server/encryption.rs:164:44: replace + with * in Envelope<'a>::to_bytes in 5.2s build + 24.7s test
  • taskchampion/src/server/cloud/server.rs:194:14: replace < with == in CloudServer::snapshot_urgency in 5.9s build + 24.6s test
  • taskchampion/src/server/cloud/gcp.rs:63:9: replace ::get -> Result<Option<Vec>> with Ok(Some(vec![0])) in 4.8s build + 24.2s test
  • taskchampion/src/server/cloud/gcp.rs:142:27: replace != with == in ::compare_and_swap in 5.1s build + 33.6s test
  • taskchampion/src/server/cloud/gcp.rs:23:72: replace == with != in is_http_error in 5.8s build + 25.1s test
  • taskchampion/src/server/encryption.rs:145:27: replace + with * in Envelope<'a>::from_bytes in 4.5s build + 24.0s test
  • taskchampion/src/taskdb/mod.rs:157:9: replace TaskDb::commit_reversed_operations -> Result with Ok(false) in 5.8s build + 24.9s test
  • taskchampion/src/utils.rs:37:9: replace ::as_ref -> &[u8] with Vec::leak(Vec::new()) in 5.3s build + 24.4s test
  • taskchampion/src/server/cloud/gcp.rs:110:9: replace ::compare_and_swap -> Result with Ok(false) in 6.3s build + 24.6s test
  • taskchampion/src/task/tag.rs:33:9: replace Tag::is_user -> bool with false in 5.4s build + 24.1s test
  • taskchampion/src/task/task.rs:40:9: replace ::eq -> bool with true in 5.8s build + 24.0s test
  • taskchampion/src/server/cloud/gcp.rs:19:5: replace is_http_error -> bool with false in 6.4s build + 24.3s test
  • taskchampion/src/replica.rs:106:9: replace Replica::all_task_uuids -> Result<Vec> with Ok(vec![]) in 5.1s build + 24.5s test
  • taskchampion/src/task/task.rs:321:9: replace Task::set_wait -> Result<()> with Ok(()) in 5.2s build + 24.3s test
  • taskchampion/src/server/cloud/gcp.rs:214:37: replace += with *= in <impl Iterator for ObjectIterator<'a>>::next in 5.5s build + 24.5s test
  • taskchampion/src/task/task.rs:244:9: replace Task::get_legacy_udas -> impl Iterator<Item =(&str, &str)>+'_ with ::std::iter::once(("", "xyzzy")) in 5.4s build + 24.8s test
  • taskchampion/src/replica.rs:106:9: replace Replica::all_task_uuids -> Result<Vec> with Ok(vec![Default::default()]) in 5.3s build + 24.7s test
  • taskchampion/src/server/cloud/gcp.rs:131:23: replace > with < in ::compare_and_swap in 5.5s build + 24.8s test
  • taskchampion/src/server/cloud/gcp.rs:63:9: replace ::get -> Result<Option<Vec>> with Ok(None) in 4.7s build + 24.4s test
  • taskchampion/src/server/cloud/gcp.rs:110:9: replace ::compare_and_swap -> Result with Ok(true) in 5.4s build + 24.7s test
  • taskchampion/src/task/task.rs:40:9: replace ::eq -> bool with false in 5.5s build + 24.2s test
  • taskchampion/src/server/cloud/gcp.rs:204:9: replace <impl Iterator for ObjectIterator<'a>>::next -> OptionSelf::Item with None in 6.5s build + 24.4s test
  • taskchampion/src/replica.rs:446:9: replace Replica::num_undo_points -> Result with Ok(1) in 5.1s build + 24.8s test
  • taskchampion/src/utils.rs:37:9: replace ::as_ref -> &[u8] with Vec::leak(vec![0]) in 5.2s build + 24.6s test
  • taskchampion/src/task/task.rs:244:9: replace Task::get_legacy_udas -> impl Iterator<Item =(&str, &str)>+'_ with ::std::iter::once(("", "")) in 6.2s build + 24.5s test
  • taskchampion/src/replica.rs:355:12: delete ! in Replica::commit_reversed_operations in 5.3s build + 24.5s test
  • taskchampion/src/server/cloud/server.rs:205:9: replace CloudServer::maybe_cleanup -> Result<()> with Ok(()) in 6.0s build + 24.4s test
@djmitche djmitche self-assigned this Sep 19, 2024
djmitche added a commit to djmitche/taskchampion that referenced this issue Sep 23, 2024
Address some missing test coverage identified by `cargo mutants` in GothenburgBitFactory#457.
djmitche added a commit that referenced this issue Sep 23, 2024
Address some missing test coverage identified by `cargo mutants` in #457.
@djmitche
Copy link
Collaborator Author

djmitche commented Oct 7, 2024

Looking through the rest of these, none are especially interesting or worth the time to investigate.

@djmitche djmitche closed this as completed Oct 7, 2024
djmitche added a commit to djmitche/taskchampion that referenced this issue Oct 24, 2024
Address some missing test coverage identified by `cargo mutants` in GothenburgBitFactory#457.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant