diff --git a/ofborg/src/commentparser.rs b/ofborg/src/commentparser.rs index 48de10d..3c01294 100644 --- a/ofborg/src/commentparser.rs +++ b/ofborg/src/commentparser.rs @@ -37,7 +37,13 @@ pub fn parse_line(text: &str) -> Option> { for command in commands { let (left, right) = command.split_at(1); match left[0].as_ref() { - "build" => instructions.push(Instruction::Build(Subset::Nixpkgs, right.to_vec())), + "build" => { + let attrs = right.to_vec(); + + if attrs.len() > 0 { + instructions.push(Instruction::Build(Subset::Nixpkgs, attrs)); + } + } "test" => { instructions.push(Instruction::Build( Subset::NixOS, @@ -94,6 +100,11 @@ mod tests { assert_eq!(None, parse(":) :) :) @grahamcofborg build hi")); } + #[test] + fn bogus_build_comment_empty_list() { + assert_eq!(None, parse("@grahamcofborg build")); + } + #[test] fn eval_comment() { assert_eq!(Some(vec![Instruction::Eval]), parse("@grahamcofborg eval")); diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 8ef5961..16b16ba 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -402,7 +402,8 @@ mod tests { owner: "ofborg-test".to_owned(), }, subset: None, - logs: Some((String::from("logs"), String::from("build.log"))), + logs: Some((Some(String::from("logs")), Some(String::from("build.log")))), + statusreport: Some((Some(String::from("build-results")), None)), }; let mut dummyreceiver = notifyworker::DummyNotificationReceiver::new();