lol

nixos/lib/testing/run: expose `rawTestDerivation`

For `testBuildFailure` and similar functions, we need a full blown derivation and not a lazy one.
This is an internal option for test framework developers.

+23 -13
+23 -13
nixos/lib/testing/run.nix
··· 16 16 ''; 17 17 }; 18 18 19 + rawTestDerivation = mkOption { 20 + type = types.package; 21 + description = mdDoc '' 22 + Unfiltered version of `test`, for troubleshooting the test framework and `testBuildFailure` in the test framework's test suite. 23 + This is not intended for general use. Use `test` instead. 24 + ''; 25 + internal = true; 26 + }; 27 + 19 28 test = mkOption { 20 29 type = types.package; 21 30 # TODO: can the interactive driver be configured to access the network? ··· 29 38 }; 30 39 31 40 config = { 32 - test = lib.lazyDerivation { # lazyDerivation improves performance when only passthru items and/or meta are used. 33 - derivation = hostPkgs.stdenv.mkDerivation { 34 - name = "vm-test-run-${config.name}"; 41 + rawTestDerivation = hostPkgs.stdenv.mkDerivation { 42 + name = "vm-test-run-${config.name}"; 35 43 36 - requiredSystemFeatures = [ "kvm" "nixos-test" ]; 44 + requiredSystemFeatures = [ "kvm" "nixos-test" ]; 37 45 38 - buildCommand = '' 39 - mkdir -p $out 46 + buildCommand = '' 47 + mkdir -p $out 40 48 41 - # effectively mute the XMLLogger 42 - export LOGFILE=/dev/null 49 + # effectively mute the XMLLogger 50 + export LOGFILE=/dev/null 43 51 44 - ${config.driver}/bin/nixos-test-driver -o $out 45 - ''; 52 + ${config.driver}/bin/nixos-test-driver -o $out 53 + ''; 46 54 47 - passthru = config.passthru; 55 + passthru = config.passthru; 48 56 49 - meta = config.meta; 50 - }; 57 + meta = config.meta; 58 + }; 59 + test = lib.lazyDerivation { # lazyDerivation improves performance when only passthru items and/or meta are used. 60 + derivation = config.rawTestDerivation; 51 61 inherit (config) passthru meta; 52 62 }; 53 63