chore(tvix/nix_cli): build with tests

only run test_nix_store_add() when the feature integration_tests is
enabled.

Change-Id: I600f08ecaefe1ce77651ae07a58d7987107ab969
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6084
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Florian Klink 2022-08-12 21:10:31 +07:00 committed by flokli
parent e6a6b0dccb
commit 43a2eaa1b6
3 changed files with 5 additions and 2 deletions

View file

@ -12,3 +12,6 @@ version = "3.2.0"
[[bin]]
name = "nix-store"
[features]
integration_tests = []

View file

@ -3,6 +3,5 @@
depot.third_party.naersk.buildPackage {
src = ./.;
doDoc = false;
# Tests invoke nix-store binary
doCheck = false;
doCheck = true;
}

View file

@ -80,6 +80,7 @@ mod integration_tests {
}
#[test]
#[cfg_attr(not(feature = "integration_tests"), ignore)]
fn test_nix_store_add() {
let file_content = "I am a copied file";
let mut tempfile = tempfile::NamedTempFile::new().expect("cannot create temp file");