massrebuilder: don't depend on nixos channel in tests

This commit is contained in:
Daiderd Jordan 2018-02-16 19:52:14 +01:00
parent 6d215f3332
commit 73a3acf8df
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -740,14 +740,24 @@ fn parse_commit_messages(messages: Vec<String>) -> Vec<String> {
mod tests {
use super::*;
use std::process::Command;
#[test]
fn stdenv_checking() {
let output = Command::new("nix-instantiate")
.args(&["--eval", "-E", "<nixpkgs>"])
.output()
.expect("nix-instantiate required");
let nixpkgs = String::from_utf8(output.stdout)
.expect("nixpkgs required");
let nix = Nix::new(String::from("x86_64-linux"), String::from("daemon"), 1200, None);
let mut stdenv =
Stdenvs::new(
nix.clone(),
PathBuf::from("/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs"),
PathBuf::from(nixpkgs.trim_right()),
);
stdenv.identify(System::X8664Linux, StdenvFrom::Before);
stdenv.identify(System::X8664Darwin, StdenvFrom::Before);