Watch
0
0
Fork
You've already forked hyperhive
0

hive-c0re: widen nix stderr predicate to cover error:/evaluation warning:, add tests

This commit is contained in:
damocles 2026-10-08 00:15:38 +02:00 • committed by mara
commit 70644cb004
3 changed files with 78 additions and 14 deletions

View file

@ -421,3 +421,31 @@ fn ensure_state_dir_creates_the_work_dir() {
assert!(notes_dir.is_dir());
assert!(root.path().join(crate::paths::WORK_SUBDIR).is_dir());
}
/// Real build failures (`error:`) and both of nix's own warning spellings
/// must stay WARN; routine progress chatter is the only thing demoted.
/// Regression guard for a first-pass predicate that only matched
/// `warning:` and silently buried `error:` lines at INFO.
#[test]
fn is_actionable_nix_line_keeps_warnings_and_errors_demotes_chatter() {
let actionable = [
"warning: Lock file entry is unlocked",
" warning: leading whitespace",
"evaluation warning: this will be an error in a future release",
"error: builder for '/nix/store/foo.drv' failed with exit code 1",
"error: 1 dependencies of derivation '/nix/store/bar.drv' failed to build",
];
for line in actionable {
assert!(is_actionable_nix_line(line), "{line}");
}
let chatter = [
"copying 3 paths",
"these 2 derivations will be built:",
"fetching git input 'git+file:///var/lib/hyperhive'",
"structuredAttrs is enabled",
];
for line in chatter {
assert!(!is_actionable_nix_line(line), "{line}");
}
}