Merge #265: testing framework: re-add features removed in nixpkgs 20.09

7e3d2965a5 testing framework: re-add features removed in nixpkgs 20.09 (Erik Arvstedt)

Pull request description:

ACKs for top commit:
  jonasnick:
    ACK 7e3d2965a5

Tree-SHA512: d5527d56866f48022f8ccea3a85c41a5ea72288bc5dc87d920894af36619103d0a2734685d4ffd7c774aeb9ed4edcd7543fd223948f4cb12c022163dbec065a7
This commit is contained in:
Jonas Nick 2020-11-14 22:13:00 +00:00
commit ddd30cbb28
No known key found for this signature in database
GPG Key ID: 4861DBF262123605

View File

@ -19,7 +19,19 @@ let
''; '';
}; };
}; };
test' = test (args // { pkgs = pkgsFixed; });
in in
test (args // { pkgs = pkgsFixed; }); # See nixpkgs/nixos/lib/testing-python.nix for the original definition
test'.overrideAttrs (_: {
# 1. Save test output
# 2. Add link to driver so that a gcroot to a test prevents the driver from
# being garbage-collected
buildCommand = ''
mkdir $out
LOGFILE=$out/output.xml tests='exec(os.environ["testScript"])' ${test'.driver}/bin/nixos-test-driver
ln -s ${test'.driver} $out/driver
'';
}) // { inherit (test') nodes driver; } ;
in in
fixedTest fixedTest