From 079b5bea820291d6f219fb5db2cf3f967481ff69 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 23:31:37 +0000 Subject: [PATCH 1/5] CI: dev profile keeps line tables only --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index bc5982898..8a83e0463 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,11 +103,16 @@ todo = "warn" too_many_arguments = "allow" type_complexity = "allow" +# Line tables keep file and line in panics and backtraces; full debug info +# for every test binary and dependency would multiply the target dir size. +# The test profile inherits both settings. [profile.dev.package."*"] opt-level = 2 +debug = false [profile.dev] opt-level = 1 +debug = "line-tables-only" [profile.release] opt-level = 3 From 40e86d48a521d15d80f370705e13f9362c8bfb00 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 23:35:30 +0000 Subject: [PATCH 2/5] CI: xtask runs tests with nextest, doctests apart, wasm in one check --- xtask/src/main.rs | 71 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index e730feb51..5000860cc 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -12,7 +12,7 @@ mod stats; mod version; use std::path::{Path, PathBuf}; -use std::process::{Command, ExitCode}; +use std::process::{Command, ExitCode, Stdio}; const USAGE: &str = "\ usage: cargo xtask @@ -21,8 +21,10 @@ commands: assets check that every icon/image/font/asset is attributed in ASSETS.md layers enforce the crate dependency layering (plan/architecture.md §3) pdf-deps verify the pinned PDF backend, including Krilla dependencies - wasm cargo check --target wasm32-unknown-unknown for the wasm-safe crates - ci fmt --check, clippy -D warnings, test, assets, layers, wasm (stops at first failure) + wasm cargo check --target wasm32-unknown-unknown for the wasm-safe crates (one call) + test workspace tests (cargo nextest when installed, else cargo test), then doctests + ci fmt --check, pdf-deps, clippy -D warnings, test, doctest, assets, layers, wasm + (stops at first failure) corpus [--download] show where test corpora live; --download fetches PngSuite into corpus/pngsuite stats [--exact] count tests and lines per crate (--exact: ask the test harness via `-- --list`) @@ -39,6 +41,7 @@ fn main() -> ExitCode { Some("layers") => cmd_layers(), Some("pdf-deps") => pdf_deps::run(&root()), Some("wasm") => cmd_wasm(), + Some("test") => cmd_test().and_then(|()| cmd_doctest()), Some("ci") => cmd_ci(), Some("corpus") => cmd_corpus(rest.contains(&"--download")), Some("stats") => stats::run(&root(), rest.contains(&"--exact")), @@ -134,21 +137,51 @@ fn wasm_set() -> Result, String> { .collect()) } +/// One `cargo check` for the whole set: each crate is checked once, and +/// `--keep-going` still reports every failing crate. Features unify across the +/// set, so each crate is checked with the union of the features the set enables. fn cmd_wasm() -> Result<(), String> { let set = wasm_set()?; - let mut results = Vec::new(); + if set.is_empty() { + return Err("no wasm-safe crates found in the workspace metadata".into()); + } + let mut c = cargo(); + c.args(["check", "--target", "wasm32-unknown-unknown", "--keep-going"]); for pkg in &set { - let mut c = cargo(); - c.args(["check", "--target", "wasm32-unknown-unknown", "-p", pkg]); - let ok = run(c, &format!("cargo check --target wasm32-unknown-unknown -p {pkg}")).is_ok(); - results.push((pkg.clone(), ok)); + c.args(["-p", pkg]); } - println!("\nwasm32-unknown-unknown check:"); - for (p, ok) in &results { - println!(" {:<6} {p}", if *ok { "ok" } else { "FAIL" }); - } - let failed = results.iter().filter(|r| !r.1).count(); - if failed == 0 { Ok(()) } else { Err(format!("{failed} crate(s) failed the wasm check")) } + run(c, &format!("cargo check --target wasm32-unknown-unknown --keep-going -p {}", set.join(" -p ")))?; + println!("\nwasm32-unknown-unknown check: ok ({} crates: {})", set.len(), set.join(", ")); + Ok(()) +} + +/// Test targets for the test build. Examples are left out so they aren't +/// linked; clippy `--all-targets` still compiles them. +const TEST_TARGETS: [&str; 4] = ["--workspace", "--lib", "--bins", "--tests"]; + +fn nextest_available() -> bool { + cargo().args(["nextest", "--version"]).stdout(Stdio::null()).stderr(Stdio::null()).status().is_ok_and(|s| s.success()) +} + +fn cmd_test() -> Result<(), String> { + let mut c = cargo(); + let tool = if nextest_available() { + c.args(["nextest", "run"]); + "nextest run" + } else { + eprintln!("note: cargo-nextest is not installed, running cargo test (cargo install cargo-nextest --locked)"); + c.arg("test"); + "test" + }; + c.args(TEST_TARGETS); + run(c, &format!("cargo {tool} {}", TEST_TARGETS.join(" "))) +} + +/// nextest does not run doctests. +fn cmd_doctest() -> Result<(), String> { + let mut c = cargo(); + c.args(["test", "--workspace", "--doc"]); + run(c, "cargo test --workspace --doc") } fn cmd_ci() -> Result<(), String> { @@ -171,14 +204,8 @@ fn cmd_ci() -> Result<(), String> { run(c, "cargo clippy --workspace --all-targets -- -D warnings") }), ), - ( - "test", - Box::new(|| { - let mut c = cargo(); - c.args(["test", "--workspace"]); - run(c, "cargo test --workspace") - }), - ), + ("test", Box::new(cmd_test)), + ("doctest", Box::new(cmd_doctest)), ("assets", Box::new(|| assets::run(&root()))), ("layers", Box::new(cmd_layers)), ("wasm", Box::new(cmd_wasm)), From 3ee11391aec7434d318654369a7b7b276882f668 Mon Sep 17 00:00:00 2001 From: aiongg Date: Thu, 22 Oct 2026 23:39:10 +0000 Subject: [PATCH 3/5] CI: one integration-test binary per crate --- ASSETS.md | 12 +++++----- apps/designcraft-cli/tests/{ => it}/cli.rs | 0 apps/designcraft-cli/tests/it/main.rs | 1 + crates/engine/tests/{ => it}/book_safety.rs | 2 -- crates/engine/tests/{ => it}/browser_print.rs | 1 - .../character_style_from_selection.rs | 0 .../engine/tests/{ => it}/close_retention.rs | 0 .../{ => it}/collection_state_atomicity.rs | 2 -- .../tests/{ => it}/combined_close_glyph.rs | 0 .../engine/tests/{ => it}/distribute_locks.rs | 0 .../tests/{ => it}/export_page_input.rs | 0 .../tests/{ => it}/insert_pages_bounds.rs | 0 crates/engine/tests/it/main.rs | 23 +++++++++++++++++++ crates/engine/tests/{ => it}/param_keys.rs | 0 crates/engine/tests/{ => it}/pdf_backend.rs | 0 .../tests/{ => it}/preflight_resolution.rs | 0 .../tests/{ => it}/primary_frame_columns.rs | 0 .../tests/{ => it}/save_state_atomicity.rs | 2 -- .../tests/{ => it}/stroke_tint_range.rs | 0 .../engine/tests/{ => it}/text_decorations.rs | 0 .../tests/{ => it}/text_insert_memory.rs | 0 .../tests/{ => it}/text_thread_regressions.rs | 0 .../tests/{ => it}/thread_color_safety.rs | 0 .../epub/tests/{ => it}/export_tag_styles.rs | 0 .../tests/{ => it}/grouped_reading_order.rs | 0 crates/epub/tests/it/main.rs | 2 ++ crates/fonts/tests/it/main.rs | 4 ++++ crates/fonts/tests/{ => it}/system_fonts.rs | 2 -- crates/images/tests/it/main.rs | 1 + .../{ => it}/rgba_conversion_contract.rs | 0 crates/mcp/tests/{ => it}/automation_roots.rs | 2 -- crates/mcp/tests/it/main.rs | 4 ++++ crates/pdf/tests/image_content_cache.rs | 5 ---- .../tests/{ => it}/gradient_color_spaces.rs | 2 +- crates/pdf/tests/it/image_content_cache.rs | 3 +++ crates/pdf/tests/it/main.rs | 6 +++++ .../{ => it}/page_entry_search_contract.rs | 0 .../render/tests/{ => it}/blend_over_paper.rs | 0 crates/render/tests/{ => it}/colorize.rs | 0 crates/render/tests/{ => it}/effects.rs | 2 +- .../render/tests/{ => it}/glyph_retention.rs | 0 crates/render/tests/{ => it}/gradient_inks.rs | 0 crates/render/tests/{ => it}/gradients.rs | 0 crates/render/tests/it/main.rs | 12 ++++++++++ crates/render/tests/{ => it}/pdf_geometry.rs | 0 crates/render/tests/{ => it}/perf.rs | 2 +- crates/render/tests/{ => it}/placed_pdf.rs | 0 .../render/tests/{ => it}/stroke_alignment.rs | 0 .../tests/{ => it}/text_frame_bottom.rs | 0 .../tests/{ => it}/text_stroke_behind.rs | 0 crates/ui-egui/tests/it/main.rs | 2 ++ .../{ => it}/native_job_lifetime_control.rs | 1 - 52 files changed, 67 insertions(+), 26 deletions(-) rename apps/designcraft-cli/tests/{ => it}/cli.rs (100%) create mode 100644 apps/designcraft-cli/tests/it/main.rs rename crates/engine/tests/{ => it}/book_safety.rs (99%) rename crates/engine/tests/{ => it}/browser_print.rs (97%) rename crates/engine/tests/{ => it}/character_style_from_selection.rs (100%) rename crates/engine/tests/{ => it}/close_retention.rs (100%) rename crates/engine/tests/{ => it}/collection_state_atomicity.rs (98%) rename crates/engine/tests/{ => it}/combined_close_glyph.rs (100%) rename crates/engine/tests/{ => it}/distribute_locks.rs (100%) rename crates/engine/tests/{ => it}/export_page_input.rs (100%) rename crates/engine/tests/{ => it}/insert_pages_bounds.rs (100%) create mode 100644 crates/engine/tests/it/main.rs rename crates/engine/tests/{ => it}/param_keys.rs (100%) rename crates/engine/tests/{ => it}/pdf_backend.rs (100%) rename crates/engine/tests/{ => it}/preflight_resolution.rs (100%) rename crates/engine/tests/{ => it}/primary_frame_columns.rs (100%) rename crates/engine/tests/{ => it}/save_state_atomicity.rs (98%) rename crates/engine/tests/{ => it}/stroke_tint_range.rs (100%) rename crates/engine/tests/{ => it}/text_decorations.rs (100%) rename crates/engine/tests/{ => it}/text_insert_memory.rs (100%) rename crates/engine/tests/{ => it}/text_thread_regressions.rs (100%) rename crates/engine/tests/{ => it}/thread_color_safety.rs (100%) rename crates/epub/tests/{ => it}/export_tag_styles.rs (100%) rename crates/epub/tests/{ => it}/grouped_reading_order.rs (100%) create mode 100644 crates/epub/tests/it/main.rs create mode 100644 crates/fonts/tests/it/main.rs rename crates/fonts/tests/{ => it}/system_fonts.rs (86%) create mode 100644 crates/images/tests/it/main.rs rename crates/images/tests/{ => it}/rgba_conversion_contract.rs (100%) rename crates/mcp/tests/{ => it}/automation_roots.rs (99%) create mode 100644 crates/mcp/tests/it/main.rs delete mode 100644 crates/pdf/tests/image_content_cache.rs rename crates/pdf/tests/{ => it}/gradient_color_spaces.rs (98%) create mode 100644 crates/pdf/tests/it/image_content_cache.rs create mode 100644 crates/pdf/tests/it/main.rs rename crates/pdf/tests/{ => it}/page_entry_search_contract.rs (100%) rename crates/render/tests/{ => it}/blend_over_paper.rs (100%) rename crates/render/tests/{ => it}/colorize.rs (100%) rename crates/render/tests/{ => it}/effects.rs (99%) rename crates/render/tests/{ => it}/glyph_retention.rs (100%) rename crates/render/tests/{ => it}/gradient_inks.rs (100%) rename crates/render/tests/{ => it}/gradients.rs (100%) create mode 100644 crates/render/tests/it/main.rs rename crates/render/tests/{ => it}/pdf_geometry.rs (100%) rename crates/render/tests/{ => it}/perf.rs (98%) rename crates/render/tests/{ => it}/placed_pdf.rs (100%) rename crates/render/tests/{ => it}/stroke_alignment.rs (100%) rename crates/render/tests/{ => it}/text_frame_bottom.rs (100%) rename crates/render/tests/{ => it}/text_stroke_behind.rs (100%) create mode 100644 crates/ui-egui/tests/it/main.rs rename crates/ui-egui/tests/{ => it}/native_job_lifetime_control.rs (98%) diff --git a/ASSETS.md b/ASSETS.md index 40e8a97b4..407a26c92 100644 --- a/ASSETS.md +++ b/ASSETS.md @@ -40,12 +40,12 @@ Generated-in-code art is original and has no file to list: the UI icon set (`cra | `docs/images/page-4.png` | DesignCraft contributors | screenshot/render of DesignCraft itself (sample document generated in code) | MIT OR Apache-2.0 | Original; no Adobe UI | | `docs/images/page-cover.png` | DesignCraft contributors | screenshot/render of DesignCraft itself (sample document generated in code) | MIT OR Apache-2.0 | Original; no Adobe UI | | `docs/images/ui-spread.png` | DesignCraft contributors | screenshot/render of DesignCraft itself (sample document generated in code) | MIT OR Apache-2.0 | Original; no Adobe UI | -| `crates/render/tests/golden/drop-shadow-spread.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | -| `crates/render/tests/golden/drop-shadow-text.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | -| `crates/render/tests/golden/drop-shadow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | -| `crates/render/tests/golden/feather.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | -| `crates/render/tests/golden/inner-shadow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | -| `crates/render/tests/golden/outer-glow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/drop-shadow-spread.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/drop-shadow-text.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/drop-shadow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/feather.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/inner-shadow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | +| `crates/render/tests/golden/outer-glow.png` | DesignCraft contributors (generated) | rendered by DesignCraft's own renderer (`crates/render/tests/it/effects.rs`, synthetic shapes and bundled fonts) | MIT OR Apache-2.0 | Golden test image for soft effects | | `assets/app-icon/LICENSE.txt` | (licence text) | this project | — | Licence for the app icon | | `assets/app-icon/designcraft-1024.png` | DesignCraft project owner (drawn in ArtCraft) | rendered from `assets/app-icon/designcraft.svg` by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | App icon: calico cat in a polka-dot scarf (see `assets/app-icon/README.md`) | | `assets/app-icon/designcraft-macos-512.png` | DesignCraft project owner (drawn in ArtCraft) | rendered from `assets/app-icon/designcraft.svg` by `packaging/icons.sh` | MIT OR Apache-2.0 (`assets/app-icon/LICENSE.txt`) | App icon: calico cat in a polka-dot scarf (see `assets/app-icon/README.md`) | diff --git a/apps/designcraft-cli/tests/cli.rs b/apps/designcraft-cli/tests/it/cli.rs similarity index 100% rename from apps/designcraft-cli/tests/cli.rs rename to apps/designcraft-cli/tests/it/cli.rs diff --git a/apps/designcraft-cli/tests/it/main.rs b/apps/designcraft-cli/tests/it/main.rs new file mode 100644 index 000000000..26710c101 --- /dev/null +++ b/apps/designcraft-cli/tests/it/main.rs @@ -0,0 +1 @@ +mod cli; diff --git a/crates/engine/tests/book_safety.rs b/crates/engine/tests/it/book_safety.rs similarity index 99% rename from crates/engine/tests/book_safety.rs rename to crates/engine/tests/it/book_safety.rs index 74c96815a..01c527be5 100644 --- a/crates/engine/tests/book_safety.rs +++ b/crates/engine/tests/it/book_safety.rs @@ -1,5 +1,3 @@ -#![cfg(not(target_arch = "wasm32"))] - use designcraft_engine::Session; use serde_json::json; use std::path::Path; diff --git a/crates/engine/tests/browser_print.rs b/crates/engine/tests/it/browser_print.rs similarity index 97% rename from crates/engine/tests/browser_print.rs rename to crates/engine/tests/it/browser_print.rs index fda224b90..208a6cde8 100644 --- a/crates/engine/tests/browser_print.rs +++ b/crates/engine/tests/it/browser_print.rs @@ -1,5 +1,4 @@ //! Browser Print must reject native spooler operations without trapping the editor. -#![cfg(target_arch = "wasm32")] use designcraft_engine::Session; use serde_json::json; diff --git a/crates/engine/tests/character_style_from_selection.rs b/crates/engine/tests/it/character_style_from_selection.rs similarity index 100% rename from crates/engine/tests/character_style_from_selection.rs rename to crates/engine/tests/it/character_style_from_selection.rs diff --git a/crates/engine/tests/close_retention.rs b/crates/engine/tests/it/close_retention.rs similarity index 100% rename from crates/engine/tests/close_retention.rs rename to crates/engine/tests/it/close_retention.rs diff --git a/crates/engine/tests/collection_state_atomicity.rs b/crates/engine/tests/it/collection_state_atomicity.rs similarity index 98% rename from crates/engine/tests/collection_state_atomicity.rs rename to crates/engine/tests/it/collection_state_atomicity.rs index b73eefa7e..cb6a0db94 100644 --- a/crates/engine/tests/collection_state_atomicity.rs +++ b/crates/engine/tests/it/collection_state_atomicity.rs @@ -1,5 +1,3 @@ -#![cfg(not(target_arch = "wasm32"))] - use designcraft_engine::Session; use serde_json::json; diff --git a/crates/engine/tests/combined_close_glyph.rs b/crates/engine/tests/it/combined_close_glyph.rs similarity index 100% rename from crates/engine/tests/combined_close_glyph.rs rename to crates/engine/tests/it/combined_close_glyph.rs diff --git a/crates/engine/tests/distribute_locks.rs b/crates/engine/tests/it/distribute_locks.rs similarity index 100% rename from crates/engine/tests/distribute_locks.rs rename to crates/engine/tests/it/distribute_locks.rs diff --git a/crates/engine/tests/export_page_input.rs b/crates/engine/tests/it/export_page_input.rs similarity index 100% rename from crates/engine/tests/export_page_input.rs rename to crates/engine/tests/it/export_page_input.rs diff --git a/crates/engine/tests/insert_pages_bounds.rs b/crates/engine/tests/it/insert_pages_bounds.rs similarity index 100% rename from crates/engine/tests/insert_pages_bounds.rs rename to crates/engine/tests/it/insert_pages_bounds.rs diff --git a/crates/engine/tests/it/main.rs b/crates/engine/tests/it/main.rs new file mode 100644 index 000000000..14555d3ee --- /dev/null +++ b/crates/engine/tests/it/main.rs @@ -0,0 +1,23 @@ +#[cfg(not(target_arch = "wasm32"))] +mod book_safety; +#[cfg(target_arch = "wasm32")] +mod browser_print; +mod character_style_from_selection; +mod close_retention; +#[cfg(not(target_arch = "wasm32"))] +mod collection_state_atomicity; +mod combined_close_glyph; +mod distribute_locks; +mod export_page_input; +mod insert_pages_bounds; +mod param_keys; +mod pdf_backend; +mod preflight_resolution; +mod primary_frame_columns; +#[cfg(not(target_arch = "wasm32"))] +mod save_state_atomicity; +mod stroke_tint_range; +mod text_decorations; +mod text_insert_memory; +mod text_thread_regressions; +mod thread_color_safety; diff --git a/crates/engine/tests/param_keys.rs b/crates/engine/tests/it/param_keys.rs similarity index 100% rename from crates/engine/tests/param_keys.rs rename to crates/engine/tests/it/param_keys.rs diff --git a/crates/engine/tests/pdf_backend.rs b/crates/engine/tests/it/pdf_backend.rs similarity index 100% rename from crates/engine/tests/pdf_backend.rs rename to crates/engine/tests/it/pdf_backend.rs diff --git a/crates/engine/tests/preflight_resolution.rs b/crates/engine/tests/it/preflight_resolution.rs similarity index 100% rename from crates/engine/tests/preflight_resolution.rs rename to crates/engine/tests/it/preflight_resolution.rs diff --git a/crates/engine/tests/primary_frame_columns.rs b/crates/engine/tests/it/primary_frame_columns.rs similarity index 100% rename from crates/engine/tests/primary_frame_columns.rs rename to crates/engine/tests/it/primary_frame_columns.rs diff --git a/crates/engine/tests/save_state_atomicity.rs b/crates/engine/tests/it/save_state_atomicity.rs similarity index 98% rename from crates/engine/tests/save_state_atomicity.rs rename to crates/engine/tests/it/save_state_atomicity.rs index ac0f30f58..2ced20ef0 100644 --- a/crates/engine/tests/save_state_atomicity.rs +++ b/crates/engine/tests/it/save_state_atomicity.rs @@ -1,5 +1,3 @@ -#![cfg(not(target_arch = "wasm32"))] - use std::path::Path; use std::sync::Arc; diff --git a/crates/engine/tests/stroke_tint_range.rs b/crates/engine/tests/it/stroke_tint_range.rs similarity index 100% rename from crates/engine/tests/stroke_tint_range.rs rename to crates/engine/tests/it/stroke_tint_range.rs diff --git a/crates/engine/tests/text_decorations.rs b/crates/engine/tests/it/text_decorations.rs similarity index 100% rename from crates/engine/tests/text_decorations.rs rename to crates/engine/tests/it/text_decorations.rs diff --git a/crates/engine/tests/text_insert_memory.rs b/crates/engine/tests/it/text_insert_memory.rs similarity index 100% rename from crates/engine/tests/text_insert_memory.rs rename to crates/engine/tests/it/text_insert_memory.rs diff --git a/crates/engine/tests/text_thread_regressions.rs b/crates/engine/tests/it/text_thread_regressions.rs similarity index 100% rename from crates/engine/tests/text_thread_regressions.rs rename to crates/engine/tests/it/text_thread_regressions.rs diff --git a/crates/engine/tests/thread_color_safety.rs b/crates/engine/tests/it/thread_color_safety.rs similarity index 100% rename from crates/engine/tests/thread_color_safety.rs rename to crates/engine/tests/it/thread_color_safety.rs diff --git a/crates/epub/tests/export_tag_styles.rs b/crates/epub/tests/it/export_tag_styles.rs similarity index 100% rename from crates/epub/tests/export_tag_styles.rs rename to crates/epub/tests/it/export_tag_styles.rs diff --git a/crates/epub/tests/grouped_reading_order.rs b/crates/epub/tests/it/grouped_reading_order.rs similarity index 100% rename from crates/epub/tests/grouped_reading_order.rs rename to crates/epub/tests/it/grouped_reading_order.rs diff --git a/crates/epub/tests/it/main.rs b/crates/epub/tests/it/main.rs new file mode 100644 index 000000000..69af15eaa --- /dev/null +++ b/crates/epub/tests/it/main.rs @@ -0,0 +1,2 @@ +mod export_tag_styles; +mod grouped_reading_order; diff --git a/crates/fonts/tests/it/main.rs b/crates/fonts/tests/it/main.rs new file mode 100644 index 000000000..1737c00b9 --- /dev/null +++ b/crates/fonts/tests/it/main.rs @@ -0,0 +1,4 @@ +// Integration tests: unwrapping and panicking on failure is fine here, unlike in shipped code. +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + +mod system_fonts; diff --git a/crates/fonts/tests/system_fonts.rs b/crates/fonts/tests/it/system_fonts.rs similarity index 86% rename from crates/fonts/tests/system_fonts.rs rename to crates/fonts/tests/it/system_fonts.rs index 62310c34b..66db0f5b1 100644 --- a/crates/fonts/tests/system_fonts.rs +++ b/crates/fonts/tests/it/system_fonts.rs @@ -1,7 +1,5 @@ //! A new session finds the installed system fonts by family name (#22). One test in its own //! process, so the process-wide database starts fresh, as it does when the app starts. -// Integration tests: unwrapping and panicking on failure is fine here, unlike in shipped code. -#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] use designcraft_fonts::{FontDb, system_font_dirs}; diff --git a/crates/images/tests/it/main.rs b/crates/images/tests/it/main.rs new file mode 100644 index 000000000..d2f76fb71 --- /dev/null +++ b/crates/images/tests/it/main.rs @@ -0,0 +1 @@ +mod rgba_conversion_contract; diff --git a/crates/images/tests/rgba_conversion_contract.rs b/crates/images/tests/it/rgba_conversion_contract.rs similarity index 100% rename from crates/images/tests/rgba_conversion_contract.rs rename to crates/images/tests/it/rgba_conversion_contract.rs diff --git a/crates/mcp/tests/automation_roots.rs b/crates/mcp/tests/it/automation_roots.rs similarity index 99% rename from crates/mcp/tests/automation_roots.rs rename to crates/mcp/tests/it/automation_roots.rs index 9380b1987..871945920 100644 --- a/crates/mcp/tests/automation_roots.rs +++ b/crates/mcp/tests/it/automation_roots.rs @@ -3,8 +3,6 @@ //! goes inside the write root. Paths that leave a root (`..`, another folder, a sibling with the //! same prefix, a link) are refused, nothing from a refused file reaches the document, and nothing //! is written outside. -// Integration tests: unwrapping and panicking on failure is fine here, unlike in shipped code (AGENTS.md). -#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] use std::path::{Path, PathBuf}; diff --git a/crates/mcp/tests/it/main.rs b/crates/mcp/tests/it/main.rs new file mode 100644 index 000000000..be744719e --- /dev/null +++ b/crates/mcp/tests/it/main.rs @@ -0,0 +1,4 @@ +// Integration tests: unwrapping and panicking on failure is fine here, unlike in shipped code (AGENTS.md). +#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)] + +mod automation_roots; diff --git a/crates/pdf/tests/image_content_cache.rs b/crates/pdf/tests/image_content_cache.rs deleted file mode 100644 index dd3d413d0..000000000 --- a/crates/pdf/tests/image_content_cache.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! Run public contracts with the production content-cache hasher. -#[path = "support/image_content_cache_contract.rs"] -mod contracts; -#[path = "support/image_fixtures.rs"] -mod image_fixtures; diff --git a/crates/pdf/tests/gradient_color_spaces.rs b/crates/pdf/tests/it/gradient_color_spaces.rs similarity index 98% rename from crates/pdf/tests/gradient_color_spaces.rs rename to crates/pdf/tests/it/gradient_color_spaces.rs index 05806a120..d906413e1 100644 --- a/crates/pdf/tests/gradient_color_spaces.rs +++ b/crates/pdf/tests/it/gradient_color_spaces.rs @@ -42,7 +42,7 @@ fn mixed_gradient_export_survives_in_subprocess() { const CHILD: &str = "DESIGNCRAFT_TEST_MIXED_GRADIENT_CHILD"; if std::env::var_os(CHILD).is_none() { let out = std::process::Command::new(std::env::current_exe().unwrap()) - .args(["--exact", "mixed_gradient_export_survives_in_subprocess", "--nocapture"]) + .args(["--exact", "gradient_color_spaces::mixed_gradient_export_survives_in_subprocess", "--nocapture"]) .env(CHILD, "1") .output() .unwrap(); diff --git a/crates/pdf/tests/it/image_content_cache.rs b/crates/pdf/tests/it/image_content_cache.rs new file mode 100644 index 000000000..ec0f666c0 --- /dev/null +++ b/crates/pdf/tests/it/image_content_cache.rs @@ -0,0 +1,3 @@ +//! Run public contracts with the production content-cache hasher. +#[path = "../support/image_content_cache_contract.rs"] +mod contracts; diff --git a/crates/pdf/tests/it/main.rs b/crates/pdf/tests/it/main.rs new file mode 100644 index 000000000..e2e092e2f --- /dev/null +++ b/crates/pdf/tests/it/main.rs @@ -0,0 +1,6 @@ +#[path = "../support/image_fixtures.rs"] +mod image_fixtures; + +mod gradient_color_spaces; +mod image_content_cache; +mod page_entry_search_contract; diff --git a/crates/pdf/tests/page_entry_search_contract.rs b/crates/pdf/tests/it/page_entry_search_contract.rs similarity index 100% rename from crates/pdf/tests/page_entry_search_contract.rs rename to crates/pdf/tests/it/page_entry_search_contract.rs diff --git a/crates/render/tests/blend_over_paper.rs b/crates/render/tests/it/blend_over_paper.rs similarity index 100% rename from crates/render/tests/blend_over_paper.rs rename to crates/render/tests/it/blend_over_paper.rs diff --git a/crates/render/tests/colorize.rs b/crates/render/tests/it/colorize.rs similarity index 100% rename from crates/render/tests/colorize.rs rename to crates/render/tests/it/colorize.rs diff --git a/crates/render/tests/effects.rs b/crates/render/tests/it/effects.rs similarity index 99% rename from crates/render/tests/effects.rs rename to crates/render/tests/it/effects.rs index a9420fbcb..230913173 100644 --- a/crates/render/tests/effects.rs +++ b/crates/render/tests/it/effects.rs @@ -3,7 +3,7 @@ //! //! Goldens live in `tests/golden/*.png` and are compared with a tolerance (antialiasing and blur //! rounding may differ by a few levels between SIMD levels). Regenerate them after an intended -//! change with `DESIGNCRAFT_BLESS=1 cargo test -p designcraft-render --test effects`. +//! change with `DESIGNCRAFT_BLESS=1 cargo test -p designcraft-render --test it effects::`. use designcraft_compose::Cache; use designcraft_doc::build::NewDocument; diff --git a/crates/render/tests/glyph_retention.rs b/crates/render/tests/it/glyph_retention.rs similarity index 100% rename from crates/render/tests/glyph_retention.rs rename to crates/render/tests/it/glyph_retention.rs diff --git a/crates/render/tests/gradient_inks.rs b/crates/render/tests/it/gradient_inks.rs similarity index 100% rename from crates/render/tests/gradient_inks.rs rename to crates/render/tests/it/gradient_inks.rs diff --git a/crates/render/tests/gradients.rs b/crates/render/tests/it/gradients.rs similarity index 100% rename from crates/render/tests/gradients.rs rename to crates/render/tests/it/gradients.rs diff --git a/crates/render/tests/it/main.rs b/crates/render/tests/it/main.rs new file mode 100644 index 000000000..52000ae2d --- /dev/null +++ b/crates/render/tests/it/main.rs @@ -0,0 +1,12 @@ +mod blend_over_paper; +mod colorize; +mod effects; +mod glyph_retention; +mod gradient_inks; +mod gradients; +mod pdf_geometry; +mod perf; +mod placed_pdf; +mod stroke_alignment; +mod text_frame_bottom; +mod text_stroke_behind; diff --git a/crates/render/tests/pdf_geometry.rs b/crates/render/tests/it/pdf_geometry.rs similarity index 100% rename from crates/render/tests/pdf_geometry.rs rename to crates/render/tests/it/pdf_geometry.rs diff --git a/crates/render/tests/perf.rs b/crates/render/tests/it/perf.rs similarity index 98% rename from crates/render/tests/perf.rs rename to crates/render/tests/it/perf.rs index 1f23f88f4..46f33ab62 100644 --- a/crates/render/tests/perf.rs +++ b/crates/render/tests/it/perf.rs @@ -1,6 +1,6 @@ //! Renderer caching/culling behaviour, and a render-time regression test (`#[ignore]`: wall-clock //! timings are only meaningful on an idle machine — run with -//! `cargo test --release -p designcraft-render --test perf -- --ignored`). +//! `cargo test --release -p designcraft-render --test it perf:: -- --ignored`). use std::time::Instant; diff --git a/crates/render/tests/placed_pdf.rs b/crates/render/tests/it/placed_pdf.rs similarity index 100% rename from crates/render/tests/placed_pdf.rs rename to crates/render/tests/it/placed_pdf.rs diff --git a/crates/render/tests/stroke_alignment.rs b/crates/render/tests/it/stroke_alignment.rs similarity index 100% rename from crates/render/tests/stroke_alignment.rs rename to crates/render/tests/it/stroke_alignment.rs diff --git a/crates/render/tests/text_frame_bottom.rs b/crates/render/tests/it/text_frame_bottom.rs similarity index 100% rename from crates/render/tests/text_frame_bottom.rs rename to crates/render/tests/it/text_frame_bottom.rs diff --git a/crates/render/tests/text_stroke_behind.rs b/crates/render/tests/it/text_stroke_behind.rs similarity index 100% rename from crates/render/tests/text_stroke_behind.rs rename to crates/render/tests/it/text_stroke_behind.rs diff --git a/crates/ui-egui/tests/it/main.rs b/crates/ui-egui/tests/it/main.rs new file mode 100644 index 000000000..2d07c9629 --- /dev/null +++ b/crates/ui-egui/tests/it/main.rs @@ -0,0 +1,2 @@ +#[cfg(not(target_arch = "wasm32"))] +mod native_job_lifetime_control; diff --git a/crates/ui-egui/tests/native_job_lifetime_control.rs b/crates/ui-egui/tests/it/native_job_lifetime_control.rs similarity index 98% rename from crates/ui-egui/tests/native_job_lifetime_control.rs rename to crates/ui-egui/tests/it/native_job_lifetime_control.rs index 2cf82e5bd..b7fa87214 100644 --- a/crates/ui-egui/tests/native_job_lifetime_control.rs +++ b/crates/ui-egui/tests/it/native_job_lifetime_control.rs @@ -1,5 +1,4 @@ //! Own a real native Job across last close. This does not run the asynchronous worker. -#![cfg(not(target_arch = "wasm32"))] use std::sync::Arc; From 0fd6e06ad6a7921c0d5df08b3d45434910827d52 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 23 Oct 2026 01:17:55 +0000 Subject: [PATCH 4/5] CI: install nextest for the test step --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 72bac7ef7..c27fdfe10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,10 @@ jobs: --target wasm32-unknown-unknown rustup default stable + - uses: taiki-e/install-action@f7e5d7c961414b23f5b25b2da9294395d08513ad # v2.87.26 + with: + tool: cargo-nextest@0.9.145 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: save-if: ${{ github.ref == 'refs/heads/main' }} From 62148670bd6ee3522c116cc1b78e2d6be0f16765 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 23 Oct 2026 02:54:21 +0000 Subject: [PATCH 5/5] CI: apt packages through craft-common-actions' cached install --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c27fdfe10..d5b820d24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,10 +45,10 @@ jobs: persist-credentials: false - name: Install Linux build dependencies - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev \ + uses: storytold/craft-common-actions/actions/install-apt-packages@main + with: + packages: >- + pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers - name: Install Rust (stable + clippy, rustfmt, wasm32)