hive-c0re: widen nix stderr predicate to cover error:/evaluation warning:, add tests
This commit is contained in:
parent
25893d0f95
commit
70644cb004
3 changed files with 78 additions and 14 deletions
|
|
@ -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}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue