nixos/testing: Embrace callTest

My conception of its input was wrong. It is quite a useful construct,
even if its name is a bit weird.
This commit is contained in:
Robert Hensing
2022-06-25 12:47:50 +02:00
parent 5297d584bc
commit 9886db059a
5 changed files with 34 additions and 20 deletions

View File

@@ -16,22 +16,22 @@ in
'';
};
run = mkOption {
test = mkOption {
type = types.package;
description = ''
Derivation that runs the test.
Derivation that runs the test as its "build" process.
'';
};
};
config = {
run = hostPkgs.stdenv.mkDerivation {
name = "vm-test-run-${config.name}";
test = lib.lazyDerivation { # lazyDerivation improves performance when only passthru items and/or meta are used.
derivation = hostPkgs.stdenv.mkDerivation {
name = "vm-test-run-${config.name}";
requiredSystemFeatures = [ "kvm" "nixos-test" ];
requiredSystemFeatures = [ "kvm" "nixos-test" ];
buildCommand =
''
buildCommand = ''
mkdir -p $out
# effectively mute the XMLLogger
@@ -40,9 +40,11 @@ in
${config.driver}/bin/nixos-test-driver -o $out
'';
passthru = config.passthru;
passthru = config.passthru;
meta = config.meta;
meta = config.meta;
};
inherit (config) passthru meta;
};
# useful for inspection (debugging / exploration)