From 05589641cfd59f093a6fd38d30bd34467713f4e4 Mon Sep 17 00:00:00 2001 From: cy Date: Mon, 28 Apr 2025 21:39:14 -0400 Subject: [PATCH] move "nix build" to tests/common --- tests/common/mod.rs | 8 ++++++++ tests/path_info.rs | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/common/mod.rs b/tests/common/mod.rs index aed468f..3870a1d 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,5 +1,6 @@ #![allow(dead_code)] +use std::process::Command; use std::sync::Arc; use nixcp::store::Store; @@ -14,6 +15,13 @@ pub struct Context { impl Context { fn new() -> Self { + // hello must be in the store + Command::new("nix") + .arg("build") + .arg("--no-link") + .arg(HELLO) + .status() + .unwrap(); let store = Arc::new(Store::connect().expect("connect to nix store")); Self { store } } diff --git a/tests/path_info.rs b/tests/path_info.rs index 2d698d0..90d113d 100644 --- a/tests/path_info.rs +++ b/tests/path_info.rs @@ -1,6 +1,5 @@ use nixcp::path_info::PathInfo; use std::path::PathBuf; -use std::process::Command; use crate::common::{HELLO, HELLO_DRV, HELLO_PATH}; @@ -18,13 +17,6 @@ async fn path_info_from_package() { #[tokio::test] async fn path_info_from_path() { - // the path must be in the store - Command::new("nix") - .arg("build") - .arg("--no-link") - .arg(HELLO) - .status() - .unwrap(); let ctx = common::context(); let path = PathBuf::from(HELLO_PATH); let path_info = PathInfo::from_derivation(&path, &ctx.store)