From 09a95b5bdda164464e5fe974a227efc9e245b922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 23 Oct 2026 15:11:51 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20test:=20forge-ci=20drops=20tests=20?= =?UTF-8?q?whose=20removal=20leaves=20every=20mutant=20caught?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Candidates found by per-test coverage set cover: 22 of 69 tests (40 forced as sole coverers, 4 without production coverage, 3 greedy-kept). Candidates that survived the mutant gate: 5 (cron: requires_five_fields, next_is_strictly_after; mask: longest_match_wins, masks_base64_encoding, masks_plain_values). Tests before: 69, after: 64. Mutants (cargo-mutants on cron.rs, mask.rs, config.rs): caught full run 193, caught reduced run 193 (equal), missed in both 15. Coverage gaps (15 mutants missed by both runs) were recorded and no tests were written for them. --- crates/forge-ci/src/cron.rs | 22 ---------------------- crates/forge-ci/src/mask.rs | 31 ------------------------------- 2 files changed, 53 deletions(-) diff --git a/crates/forge-ci/src/cron.rs b/crates/forge-ci/src/cron.rs index d376e85..8967e92 100644 --- a/crates/forge-ci/src/cron.rs +++ b/crates/forge-ci/src/cron.rs @@ -47,28 +47,6 @@ mod tests { // 2026-10-15 12:00:00 UTC const NOON: i64 = 1_791_979_200; - #[test] - fn requires_five_fields() { - assert!(parse("0 3 * * *").is_ok()); - assert!(parse("0 0 3 * * *").is_err()); - assert!(parse("0 3 * *").is_err()); - assert!(parse("61 3 * * *").is_err()); - assert!(parse("nope").is_err()); - } - - #[test] - fn next_is_strictly_after() { - let day = 86_400; - let three = NOON - 9 * 3600 + day; - assert_eq!(next_after(&["0 3 * * *"], NOON), Some(three)); - assert_eq!(next_after(&["0 3 * * *"], three), Some(three + day)); - assert_eq!( - next_after(&["0 3 * * *", "30 12 * * *"], NOON), - Some(NOON + 1800) - ); - assert_eq!(next_after::<&str>(&[], NOON), None); - } - #[test] fn fires_inside_the_window_only() { assert!(fired_between(&["30 12 * * *"], NOON, NOON + 1800)); diff --git a/crates/forge-ci/src/mask.rs b/crates/forge-ci/src/mask.rs index ee65c35..ad9c8b6 100644 --- a/crates/forge-ci/src/mask.rs +++ b/crates/forge-ci/src/mask.rs @@ -141,31 +141,6 @@ mod tests { String::from_utf8(out).unwrap() } - #[test] - fn masks_plain_values() { - let m = masker(&["hunter2-secret"]); - let cases = [ - ("token=hunter2-secret ok", "token=*** ok"), - ("two hunter2-secret and hunter2-secret", "two *** and ***"), - ("nothing here", "nothing here"), - ("héllo 🙂 hunter2-secret ✓", "héllo 🙂 *** ✓"), - ]; - for (input, want) in cases { - assert_eq!(m.mask(input), want, "case {input:?}"); - } - } - - #[test] - fn masks_base64_encoding() { - let secret = "hunter2-secret"; - let encoded = STANDARD.encode(secret.as_bytes()); - let m = masker(&[secret]); - assert_eq!(m.mask(&format!("leak: {encoded}")), "leak: ***"); - let other = masker(&["abcdefgh"]); - let enc = STANDARD.encode("abcdefgh"); - assert_eq!(other.mask(&enc), "***"); - } - #[test] fn short_values_are_ignored() { let m = masker(&["abc", "", "ab"]); @@ -175,12 +150,6 @@ mod tests { assert_eq!(m.mask("xabcdx"), "x***x"); } - #[test] - fn longest_match_wins() { - let m = masker(&["secret-value", "secret"]); - assert_eq!(m.mask("a secret-value b"), "a *** b"); - } - #[test] fn empty_secret_set_is_a_no_op() { let m = Masker::new(std::iter::empty());