xtask/tests/ci_builds_with_holger.rs
//! Guard (lane DW-HOLGER-BUILD, 2026-10-31): dwarves main stopped building against holger
//! main and nobody saw it. Holger 3.0.0 (holger d2dbf078) moved every holger crate to 3.0,
//! while dwarves and nornir still asked for `holger-server-lib = "2.0"` by path: the
//! workspace no longer resolved, so no dwarves binary could be built from main and the
//! media lanes composed with an older forge. The quick set built only the default
//! features, and the forge ran no dwarves pipeline at all.
//!
//! So the quick set carries a step that BUILDS dwarves with holger in it (`embed-holger`,
//! which also turns on nornir's embedded holger, `rehearse` and the media forge's
//! `sign-step`), against whatever holger checkout sits beside it: on the forge, holger
//! main's head (ci.dwarves.toml follows it).
use std::process::Command;
fn quick_list() -> String {
let o = Command::new(env!("CARGO_BIN_EXE_xtask")).args(["ci", "--quick", "--list"]).output().unwrap();
assert!(o.status.success(), "xtask ci --quick --list: {}", String::from_utf8_lossy(&o.stderr));
String::from_utf8(o.stdout).unwrap()
}
#[test]
fn the_quick_set_builds_dwarves_with_holger_in_it() {
let list = quick_list();
let line = list
.lines()
.find(|l| l.split_whitespace().next() == Some("build:holger"))
.unwrap_or_else(|| panic!("no build:holger step in the quick set:\n{list}"));
let words: Vec<&str> = line.split_whitespace().collect();
let cmd = words.iter().position(|w| *w == "cargo").map(|i| &words[i..]).unwrap_or_else(|| panic!("{line}"));
assert_eq!(&cmd[..4], ["cargo", "build", "-p", "dwarves"], "{line}");
assert!(list.lines().any(|l| l.split_whitespace().next() == Some("lockcheck")), "lockcheck stays in the quick set");
// a lock that trails holger is lockcheck's red; this step asks only whether it builds
assert!(!cmd.contains(&"--locked"), "build:holger builds against holger's head as it is: {line}");
let feats = cmd.iter().position(|w| *w == "--features").map(|i| cmd[i + 1]).unwrap_or_else(|| panic!("{line}"));
let feats: Vec<&str> = feats.split(',').collect();
for f in ["embed-holger", "rehearse", "sign-step"] {
assert!(feats.contains(&f), "build:holger builds `{f}`: {line}");
}
}