Merge pull request #309 from NixOS/fixup-tests-darwin

Fixup tests darwin
This commit is contained in:
Graham Christensen 2019-01-26 10:33:10 -05:00 committed by GitHub
commit a162d41fb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 9 deletions

View file

@ -17,4 +17,12 @@ impl System {
pub fn as_build_destination(&self) -> (Option<String>, Option<String>) { pub fn as_build_destination(&self) -> (Option<String>, Option<String>) {
(None, Some(format!("build-inputs-{}", self.to_string()))) (None, Some(format!("build-inputs-{}", self.to_string())))
} }
pub fn can_run_nixos_tests(&self) -> bool {
match self {
System::X8664Linux => true,
System::Aarch64Linux => true,
System::X8664Darwin => false,
}
}
} }

View file

@ -101,10 +101,6 @@ impl<'a, 'b> JobActions<'a, 'b> {
self.tell(worker::Action::Ack); self.tell(worker::Action::Ack);
} }
pub fn nasty_hack_linux_only(&mut self) {
self.tell(worker::Action::Ack);
}
pub fn nothing_to_do(&mut self) { pub fn nothing_to_do(&mut self) {
self.tell(worker::Action::Ack); self.tell(worker::Action::Ack);
} }
@ -310,11 +306,6 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker {
_ => nix::File::DefaultNixpkgs, _ => nix::File::DefaultNixpkgs,
}; };
if buildfile == nix::File::ReleaseNixOS && self.system == "x86_64-darwin" {
actions.nasty_hack_linux_only();
return;
}
let refpath = co.checkout_origin_ref(target_branch.as_ref()).unwrap(); let refpath = co.checkout_origin_ref(target_branch.as_ref()).unwrap();
co.fetch_pr(job.pr.number).unwrap(); co.fetch_pr(job.pr.number).unwrap();

View file

@ -109,6 +109,15 @@ impl worker::SimpleWorker for GitHubCommentWorker {
for instruction in instructions { for instruction in instructions {
match instruction { match instruction {
commentparser::Instruction::Build(subset, attrs) => { commentparser::Instruction::Build(subset, attrs) => {
let build_destinations = match subset {
commentparser::Subset::NixOS => build_destinations
.clone()
.into_iter()
.filter(|x| x.can_run_nixos_tests())
.collect(),
_ => build_destinations.clone(),
};
let msg = buildjob::BuildJob::new( let msg = buildjob::BuildJob::new(
repo_msg.clone(), repo_msg.clone(),
pr_msg.clone(), pr_msg.clone(),