1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 06:53:54 +02:00

Test derivation options with content-addressing too

Now, both the unit and functional tests relating to derivation options
are tested both ways -- with input addressing and content-addressing
derivations.
This commit is contained in:
John Ericson 2025-04-14 11:15:56 -04:00
parent 7acc229c8f
commit 307dbe9914
37 changed files with 560 additions and 94 deletions

View file

@ -12,11 +12,19 @@ badExitCode=0
store="$TEST_ROOT/store"
if [[ -z "${NIX_TESTS_CA_BY_DEFAULT:-}" ]]; then
drvDir=ia
flags=(--arg contentAddress false)
else
drvDir=ca
flags=(--arg contentAddress true --extra-experimental-features ca-derivations)
fi
for nixFile in derivation/*.nix; do
drvPath=$(env -u NIX_STORE nix-instantiate --store "$store" --pure-eval --expr "$(< "$nixFile")")
drvPath=$(env -u NIX_STORE nix-instantiate --store "$store" --pure-eval "${flags[@]}" --expr "$(< "$nixFile")")
testName=$(basename "$nixFile" .nix)
got="${store}${drvPath}"
expected="derivation/$testName.drv"
expected="derivation/${drvDir}/${testName}.drv"
diffAndAcceptInner "$testName" "$got" "$expected"
done