diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e78fe1ea3b..983bdf8ad5 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 63ca129867..f8f63c7812 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/crates/layout/src/tests.rs b/crates/layout/src/tests.rs index 5218ad5c7f..40144d7f8e 100644 --- a/crates/layout/src/tests.rs +++ b/crates/layout/src/tests.rs @@ -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;