handle nixUnstable output

This commit is contained in:
Daiderd Jordan 2020-11-07 17:27:31 +01:00
parent 2ddee3c3ff
commit 8c91336e65
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 8 additions and 4 deletions

View file

@ -757,10 +757,12 @@ mod tests {
"trace: You just can't frooble the frozz on this particular system." "trace: You just can't frooble the frozz on this particular system."
); );
eprintln!("{:?}", ret.1[1].1);
assert_eq!(ret.1[1].0, "missing-attr"); assert_eq!(ret.1[1].0, "missing-attr");
let s = strip_ansi(&ret.1[1].1.last().unwrap());
assert_eq!( assert_eq!(
strip_ansi(&ret.1[1].1[0]), s.trim_start_matches("error: "),
"error: attribute 'missing-attr' in selection path 'missing-attr' not found" "attribute 'missing-attr' in selection path 'missing-attr' not found"
); );
} }
@ -823,7 +825,6 @@ mod tests {
ret, ret,
Expect::Fail, Expect::Fail,
vec![ vec![
"error: while evaluating the attribute",
"access to path", "access to path",
"is forbidden in restricted mode", "is forbidden in restricted mode",
], ],

View file

@ -551,7 +551,10 @@ mod tests {
&mut actions, &mut actions,
"\"line_number\":1,\"output\":\"Cannot nix-instantiate `not-real\' because:\"", "\"line_number\":1,\"output\":\"Cannot nix-instantiate `not-real\' because:\"",
); );
assert_contains_job(&mut actions, "\"line_number\":2,\"output\":\"error: attribute 'not-real' in selection path 'not-real' not found\"}"); assert_contains_job(
&mut actions,
"attribute 'not-real' in selection path 'not-real' not found\"}",
);
assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // First one to the github poster assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // First one to the github poster
assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // This one to the logs assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // This one to the logs
assert_eq!(actions.next(), Some(worker::Action::Ack)); assert_eq!(actions.next(), Some(worker::Action::Ack));