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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user