From 8c91336e65741b39f4aafb53912a7c927b175468 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 7 Nov 2020 17:27:31 +0100 Subject: [PATCH] handle nixUnstable output --- ofborg/src/nix.rs | 7 ++++--- ofborg/src/tasks/build.rs | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 2d9d0ed..5419984 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -757,10 +757,12 @@ mod tests { "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"); + let s = strip_ansi(&ret.1[1].1.last().unwrap()); assert_eq!( - strip_ansi(&ret.1[1].1[0]), - "error: attribute 'missing-attr' in selection path 'missing-attr' not found" + s.trim_start_matches("error: "), + "attribute 'missing-attr' in selection path 'missing-attr' not found" ); } @@ -823,7 +825,6 @@ mod tests { ret, Expect::Fail, vec![ - "error: while evaluating the attribute", "access to path", "is forbidden in restricted mode", ], diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index bb37deb..597d9cc 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -551,7 +551,10 @@ mod tests { &mut actions, "\"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"); // This one to the logs assert_eq!(actions.next(), Some(worker::Action::Ack));