don't force daemon for tests

This commit is contained in:
Daiderd Jordan 2018-04-04 23:00:00 +02:00
parent bfa6af6929
commit 04d0c2f540
No known key found for this signature in database
GPG key ID: D02435D05B810C96
3 changed files with 10 additions and 4 deletions

View file

@ -275,7 +275,8 @@ fn lines_from_file(file: File) -> Vec<String> {
#[cfg(test)]
mod tests {
fn nix() -> Nix {
Nix::new("x86_64-linux".to_owned(), "daemon".to_owned(), 1800, None)
let remote = env::var("NIX_REMOTE").unwrap_or("".to_owned());
Nix::new("x86_64-linux".to_owned(), remote, 1800, None)
}
fn noop(operation: Operation) -> Operation {
@ -502,7 +503,8 @@ mod tests {
#[test]
fn safe_command_custom_gc() {
let nix = Nix::new("x86_64-linux".to_owned(), "daemon".to_owned(), 1800, Some("4g".to_owned()));
let remote = env::var("NIX_REMOTE").unwrap_or("".to_owned());
let nix = Nix::new("x86_64-linux".to_owned(), remote, 1800, Some("4g".to_owned()));
let ret: Result<File, File> =
nix.run(

View file

@ -400,6 +400,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker {
#[cfg(test)]
mod tests {
use super::*;
use std::env;
use std::path::{Path, PathBuf};
use ofborg::message::{Pr, Repo};
use notifyworker::SimpleNotifyWorker;
@ -408,7 +409,8 @@ mod tests {
use ofborg::test_scratch::TestScratch;
fn nix() -> nix::Nix {
nix::Nix::new("x86_64-linux".to_owned(), "daemon".to_owned(), 1800, None)
let remote = env::var("NIX_REMOTE").unwrap_or("".to_owned());
nix::Nix::new("x86_64-linux".to_owned(), remote, 1800, None)
}
fn tpath(component: &str) -> PathBuf {

View file

@ -786,6 +786,7 @@ fn parse_commit_messages(messages: Vec<String>) -> Vec<String> {
mod tests {
use super::*;
use std::env;
use std::process::Command;
#[test]
@ -798,7 +799,8 @@ mod tests {
let nixpkgs = String::from_utf8(output.stdout)
.expect("nixpkgs required");
let nix = nix::Nix::new(String::from("x86_64-linux"), String::from("daemon"), 1200, None);
let remote = env::var("NIX_REMOTE").unwrap_or("".to_owned());
let nix = nix::Nix::new(String::from("x86_64-linux"), remote, 1200, None);
let mut stdenv =
Stdenvs::new(
nix.clone(),