From 5cad55023f03211bcffa5d5931dae27d1bffa04d Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Mon, 9 Nov 2026 15:17:30 -0700 Subject: [PATCH] fix(test): the backup folder test names a folder the host calls rooted; the portable jobs report every failure The portable-windows gate has been red on main for four pushes (7a5cb6873 to 652f9da87). The settings test V-D2 added set backup.folder to /mnt/backup/books. A backup folder is a folder on the server's own computer, so the key is checked by the host's path rules, and on Windows that path names no disk: the check refused it, rightly, and the test's unwrap panicked. The rule and the code are unchanged; the test now names a folder the host takes (D:\backup\books there). cargo test stops at the first failing test binary, so that one test hid whatever fails after it. The two portable jobs take most of an hour each; they now run with --no-fail-fast, so one red run shows every failure. Co-Authored-By: Claude --- .github/workflows/portable-macos.yml | 6 +++++- .github/workflows/portable-windows.yml | 6 +++++- crates/ledger-core/tests/settings_refusals.rs | 15 +++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/portable-macos.yml b/.github/workflows/portable-macos.yml index af6425a1..eef93a86 100644 --- a/.github/workflows/portable-macos.yml +++ b/.github/workflows/portable-macos.yml @@ -52,7 +52,11 @@ jobs: - name: Everything compiles run: cargo build --workspace --all-targets - name: Tests - run: cargo test --workspace + # Every failure in one run: this job takes most of an hour, and + # cargo stops at the first failing test binary otherwise, hiding + # whatever fails after it (2026-11-09: four red pushes showed one + # test). + run: cargo test --workspace --no-fail-fast - name: What the build used if: always() shell: bash diff --git a/.github/workflows/portable-windows.yml b/.github/workflows/portable-windows.yml index a92a5850..43551b20 100644 --- a/.github/workflows/portable-windows.yml +++ b/.github/workflows/portable-windows.yml @@ -52,7 +52,11 @@ jobs: - name: Everything compiles run: cargo build --workspace --all-targets - name: Tests - run: cargo test --workspace + # Every failure in one run: this job takes most of an hour, and + # cargo stops at the first failing test binary otherwise, hiding + # whatever fails after it (2026-11-09: four red pushes showed one + # test). + run: cargo test --workspace --no-fail-fast - name: What the build used if: always() shell: bash diff --git a/crates/ledger-core/tests/settings_refusals.rs b/crates/ledger-core/tests/settings_refusals.rs index 487e07b6..e2178e47 100644 --- a/crates/ledger-core/tests/settings_refusals.rs +++ b/crates/ledger-core/tests/settings_refusals.rs @@ -39,6 +39,17 @@ fn src() -> Source { } } +/// A folder the host calls rooted. `backup.folder` is a folder on the +/// server's own computer, so it is checked by the host's path rules: on +/// Windows `/mnt/backup/books` names no disk and is refused (the +/// portable-windows gate, 2026-11-09), so the test names one the host +/// takes. +const BACKUP_FOLDER: &str = if cfg!(windows) { + r"D:\backup\books" +} else { + "/mnt/backup/books" +}; + fn change(k: &str, v: Value) -> Change { Change { key: k.into(), @@ -540,7 +551,7 @@ fn readers_give_the_default_unset_and_the_word_when_set() { ), ("policy.cpa_package_requires_audit", json!("refuse")), ("backup.git_remote", json!("git@git.example:books.git")), - ("backup.folder", json!("/mnt/backup/books")), + ("backup.folder", json!(BACKUP_FOLDER)), ]); assert_eq!(set.schedule_convention(), ScheduleConvention::MonthlyEven); assert_eq!(set.parties(), PartyPolicy::Require); @@ -552,7 +563,7 @@ fn readers_give_the_default_unset_and_the_word_when_set() { ); assert_eq!(set.cpa_package_requires_audit(), Some(true)); assert_eq!(set.backup_git_remote(), Some("git@git.example:books.git")); - assert_eq!(set.backup_folder(), Some("/mnt/backup/books")); + assert_eq!(set.backup_folder(), Some(BACKUP_FOLDER)); let warn = settings(&[("policy.cpa_package_requires_audit", json!("warn"))]); assert_eq!(warn.cpa_package_requires_audit(), Some(false));