From bb1f62b4fee5969ce73cfa9dc36e7e8f531993a2 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sat, 10 Mar 2018 18:59:19 -0500 Subject: [PATCH] Drop Finished messages on the floor --- ofborg/src/tasks/build.rs | 6 ++++-- ofborg/src/tasks/log_message_collector.rs | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index f85004c..edf524a 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -492,7 +492,8 @@ mod tests { assert_contains_job(&mut actions, "output\":\"2"); assert_contains_job(&mut actions, "output\":\"3"); assert_contains_job(&mut actions, "output\":\"4"); - assert_contains_job(&mut actions, "success\":true"); + assert_contains_job(&mut actions, "success\":true"); // First one to the github poster + assert_contains_job(&mut actions, "success\":true"); // This one to the logs assert_eq!(actions.next(), Some(worker::Action::Ack)); } @@ -533,7 +534,8 @@ mod tests { println!("Total actions: {:?}", dummyreceiver.actions.len()); let mut actions = dummyreceiver.actions.into_iter(); - assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); + 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)); } } diff --git a/ofborg/src/tasks/log_message_collector.rs b/ofborg/src/tasks/log_message_collector.rs index 81a682c..6855afa 100644 --- a/ofborg/src/tasks/log_message_collector.rs +++ b/ofborg/src/tasks/log_message_collector.rs @@ -207,7 +207,9 @@ impl worker::SimpleWorker for LogMessageCollector { handle.write_to_line((message.line_number - 1) as usize, &message.output); - } + }, + MsgType::Finish(ref _finish) => { + }, } return vec![worker::Action::Ack]; @@ -343,7 +345,7 @@ mod tests { }; let mut job = LogMessage { from: make_from("foo"), - message: Right(logmsg.clone()), + message: MsgType::Msg(logmsg.clone()), }; let p = TestScratch::new_dir("log-message-collector-path_for_log"); @@ -354,7 +356,7 @@ mod tests { worker.consumer(& LogMessage { from: make_from("foo"), - message: Left(BuildLogStart { + message: MsgType::Start(BuildLogStart { attempt_id: String::from("my-attempt-id"), identity: String::from("my-identity"), system: String::from("foobar-x8664"), @@ -369,14 +371,14 @@ mod tests { logmsg.line_number = 5; logmsg.output = String::from("line-5"); - job.message = Right(logmsg.clone()); + job.message = MsgType::Msg(logmsg.clone()); assert_eq!(vec![worker::Action::Ack], worker.consumer(&job)); job.from.attempt_id = String::from("my-other-attempt"); logmsg.attempt_id = String::from("my-other-attempt"); logmsg.line_number = 3; logmsg.output = String::from("line-3"); - job.message = Right(logmsg.clone()); + job.message = MsgType::Msg(logmsg.clone()); assert_eq!(vec![worker::Action::Ack], worker.consumer(&job)); }