Add test for the evaluation cache

This commit is contained in:
Eelco Dolstra 2024-05-24 16:16:38 +02:00
parent c90a763273
commit 8b86f415c1
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,22 @@
source ./common.sh
requireGit
flake1Dir="$TEST_ROOT/eval-cache-flake"
createGitRepo "$flake1Dir" ""
cat >"$flake1Dir/flake.nix" <<EOF
{
description = "Fnord";
outputs = { self }: {
foo.bar = throw "breaks";
};
}
EOF
git -C "$flake1Dir" add flake.nix
git -C "$flake1Dir" commit -m "Init"
expect 1 nix build "$flake1Dir#foo.bar" 2>&1 | grepQuiet 'error: breaks'
expect 1 nix build "$flake1Dir#foo.bar" 2>&1 | grepQuiet 'error: breaks'

View file

@ -16,6 +16,7 @@ nix_tests = \
flakes/build-paths.sh \
flakes/flake-in-submodule.sh \
flakes/prefetch.sh \
flakes/eval-cache.sh \
gc.sh \
nix-collect-garbage-d.sh \
remote-store.sh \