mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
Add a test for the gc with CA derivations
Also add a small architecture to easily run CA-enabled tests
This commit is contained in:
parent
96d7170e12
commit
a3ce88725b
12
tests/ca/gc.sh
Executable file
12
tests/ca/gc.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Ensure that garbage collection works properly with ca derivations
|
||||
|
||||
source common.sh
|
||||
|
||||
sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_DIR"/nix.conf
|
||||
|
||||
export NIX_TESTS_CA_BY_DEFAULT=1
|
||||
|
||||
cd ..
|
||||
source gc.sh
|
@ -1,3 +1,12 @@
|
||||
let
|
||||
contentAddressedByDefault = builtins.getEnv "NIX_TESTS_CA_BY_DEFAULT" == "1";
|
||||
caArgs = if contentAddressedByDefault then {
|
||||
__contentAddressed = true;
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
} else {};
|
||||
in
|
||||
|
||||
rec {
|
||||
shell = "@bash@";
|
||||
|
||||
@ -15,4 +24,4 @@ rec {
|
||||
PATH = path;
|
||||
} // removeAttrs args ["builder" "meta"])
|
||||
// { meta = args.meta or {}; };
|
||||
}
|
||||
} // caArgs
|
||||
|
@ -2,6 +2,7 @@ nix_tests = \
|
||||
hash.sh lang.sh add.sh simple.sh dependencies.sh \
|
||||
config.sh \
|
||||
gc.sh \
|
||||
ca/gc.sh \
|
||||
gc-concurrent.sh \
|
||||
gc-auto.sh \
|
||||
referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \
|
||||
|
Loading…
Reference in New Issue
Block a user