From 801963c6992be72eba2bb070b1305388bd446532 Mon Sep 17 00:00:00 2001 From: Colin Rofls Date: Fri, 28 Feb 2025 12:25:13 -0500 Subject: [PATCH] [crater] Work around diffs rounded to 100% Sometimes ttx_diff reports a diff with ratio of 1.0, and we were treating this the same as if it was identical. This patch makes sure we are distinguishing between 'identical' and 'very very close' by manually nudging the percent in this case. --- fontc_crater/src/ci/html.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fontc_crater/src/ci/html.rs b/fontc_crater/src/ci/html.rs index 649899ed..f823386c 100644 --- a/fontc_crater/src/ci/html.rs +++ b/fontc_crater/src/ci/html.rs @@ -410,7 +410,12 @@ fn make_diff_report( k, match v { DiffOutput::Identical => 100.0, - DiffOutput::Diffs(d) => d.get("total").unwrap().ratio().unwrap() * 100.0, + DiffOutput::Diffs(d) => { + // sometimes the output is rounded up to 100 but is + // not actually identical: we want to not show that as 100! + let diff_perc = d.get("total").unwrap().ratio().unwrap() * 100.0; + diff_perc.min(99.999) + } }, ) })