CI: fix red SonarCloud on main (#6859)

The coverage shards failed six tests on every main push:
- three UI glyph tests: the Sonar job had no craft-fonts. Pass the same
  fonts-ref as ci.yml.
- three layout linear-time tests: llvm-cov instrumentation pushes the
  8x time ratio past 24 (24.2-31.2). Ignore them under cfg(coverage),
  which cargo llvm-cov sets; the gate CI still runs them.


Claude-Session: https://claude.ai/code/session_01FypgCXtSjB6e5jmy9Uq7u8

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Martin BallandClaude Opus 5.5 authored and GitHub committed 2026-11-16 12:06:41 +00:00
1 parent fe8a8a838c
commit 54e3e1cf34
3 files changed
+8

No files matched your search

+3
View File
@@ -18,4 +18,7 @@ jobs:
sonarcloud:
# Tracked at @main so org-wide CI improvements propagate without PR churn.
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
with:
# Same craft-fonts commit as ci.yml: the UI glyph tests need its CJK and Arabic fonts.
fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
secrets: inherit
+2
View File
@@ -122,6 +122,8 @@ arboard = { version = "3.7", default-features = false, features = ["wayland-data
[workspace.lints.rust]
unsafe_code = "forbid"
# cargo llvm-cov sets `--cfg coverage`; timing tests skip themselves under its instrumentation.
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(coverage)"] }
[workspace.lints.clippy]
cognitive_complexity = "deny"
+3
View File
@@ -914,6 +914,7 @@ fn long_word_beside_a_float(n: usize) -> Document {
/// A word with no break opportunity in it: measuring the word for every line it takes scanned
/// the whole paragraph each time, so the layout was quadratic in the word's length.
#[test]
#[cfg_attr(coverage, ignore = "coverage instrumentation skews the time ratio")]
fn a_long_unbreakable_word_lays_out_in_linear_time() {
let (t1, tk, ratio) = layout_time_ratio(long_word_beside_a_float, 50_000, &LayoutOptions::default());
eprintln!("t(n) {t1:.4} s, t(8n) {tk:.4} s, ratio {ratio:.1}");
@@ -1134,6 +1135,7 @@ fn long_word_with_alternating_advances_beside_a_float(n: usize) -> Document {
/// A word whose advances alternate in sign lays out in linear time: the measurement that asks
/// whether it would fit the full line must not walk the word again for every line it takes.
#[test]
#[cfg_attr(coverage, ignore = "coverage instrumentation skews the time ratio")]
fn a_word_with_alternating_advances_lays_out_in_linear_time() {
let (t1, tk, ratio) = layout_time_ratio(long_word_with_alternating_advances_beside_a_float, 50_000, &LayoutOptions::default());
eprintln!("t(n) {t1:.4} s, t(8n) {tk:.4} s, ratio {ratio:.1}");
@@ -7839,6 +7841,7 @@ fn a_no_break_space_before_a_slash_still_holds() {
}
#[test]
#[cfg_attr(coverage, ignore = "coverage instrumentation skews the time ratio")]
fn unequal_formats_lay_out_in_linear_time() {
crate::test_fonts();
// Runs whose formats never compare equal (NaN spacing from a hostile file) each get a style;