From 11946817f0858115f8afbfacd5b65d47552d37a7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 1 Jul 2024 14:31:04 -0400 Subject: [PATCH] fileset for store unit test data --- src/nix-store-tests/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/nix-store-tests/package.nix b/src/nix-store-tests/package.nix index e6750771f..243b9f149 100644 --- a/src/nix-store-tests/package.nix +++ b/src/nix-store-tests/package.nix @@ -86,14 +86,18 @@ mkMesonDerivation (finalAttrs: { passthru = { tests = { run = let - # Inline some drv files shared with the libexpr tests - data = runCommand "${finalAttrs.pname}-test-data" {} '' - cp -r --no-preserve=mode ${./data} $out - cp -r --remove-destination ${../../tests/functional/derivation}/* $out/derivation/ - ''; + # Some data is shared with the functional tests: they create it, + # we consume it. + data = lib.fileset.toSource { + root = ../..; + fileset = lib.fileset.unions [ + ./data + ../../tests/functional/derivation + ]; + }; in runCommand "${finalAttrs.pname}-run" {} '' PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH" - export _NIX_TEST_UNIT_DATA=${data} + export _NIX_TEST_UNIT_DATA=${data + "/src/nix-store-test/data"} nix-store-tests touch $out '';