From c32b688e0ef5036d7487efb5aa8794d627e583a5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 5 Oct 2026 09:13:17 +0200 Subject: [PATCH] test: delete three tests a sibling already covers An audit of every test suite for tautological tests (MRGFY-10043) found three tests here that cannot catch a defect the rest of the suite misses: - recover_pending_rejects_plain_reason never reaches recover_pending's own logic, since plain text is rejected by parse() first. parse_plain_reason_returns_none covers that, and recover_pending_rejects_mismatched_last_entry covers the filter. - detect_local_timezone_returns_a_value exercises iana-time-zone and the host environment through a one-line wrapper. It fails only if the wrapper always errors. - skill_content_is_readable is strictly subsumed by skill_has_valid_frontmatter, which reads the same file and also needs its frontmatter. Delete them. Related to MRGFY-10043 Co-Authored-By: Claude Opus 5.5 Change-Id: Ie703b6e2f3da9b26092e71fca350d031f5331fd9 --- crates/mergify-cli/tests/skill_references.rs | 5 ----- crates/mergify-freeze/src/common.rs | 11 ----------- crates/mergify-stack/src/revision_note.rs | 15 --------------- 3 files changed, 31 deletions(-) diff --git a/crates/mergify-cli/tests/skill_references.rs b/crates/mergify-cli/tests/skill_references.rs index e0a8a2f7..832c9a33 100644 --- a/crates/mergify-cli/tests/skill_references.rs +++ b/crates/mergify-cli/tests/skill_references.rs @@ -71,11 +71,6 @@ fn native_commands_for_group(group: &str) -> BTreeSet { .collect() } -#[test] -fn skill_content_is_readable() { - assert!(!skill_content().is_empty(), "SKILL.md must not be empty"); -} - #[test] fn skill_has_valid_frontmatter() { let content = skill_content(); diff --git a/crates/mergify-freeze/src/common.rs b/crates/mergify-freeze/src/common.rs index 77e1eb65..3a006c3a 100644 --- a/crates/mergify-freeze/src/common.rs +++ b/crates/mergify-freeze/src/common.rs @@ -228,15 +228,4 @@ mod tests { "2026-01-01T10:00:00 (Europe/Paris)", ); } - - #[test] - fn detect_local_timezone_returns_a_value() { - // We can't assert a specific timezone (varies by environment), - // but we can assert that detection doesn't fail outright in - // a normal dev / CI environment. If this fires in a sandbox - // that masks `TZ`, the `iana-time-zone` crate falls back to - // `/etc/localtime` on Unix — both routes work in CI. - let tz = detect_local_timezone().expect("local timezone detectable"); - assert!(!tz.is_empty()); - } } diff --git a/crates/mergify-stack/src/revision_note.rs b/crates/mergify-stack/src/revision_note.rs index 913b9f8b..87ae526a 100644 --- a/crates/mergify-stack/src/revision_note.rs +++ b/crates/mergify-stack/src/revision_note.rs @@ -322,21 +322,6 @@ mod tests { ); } - #[test] - fn recover_pending_rejects_plain_reason() { - assert!( - recover_pending( - "fixed a typo in the docs", - GH, - "o", - "r", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", - ) - .is_none() - ); - } - // --- git IO --- fn init_repo() -> TempDir {