Merge pull request #112504 from hercules-ci/fix-nixosTest-meta-position
nixosTest: fix meta.position
This commit is contained in:
commit
b2f44e9aeb
|
@ -55,7 +55,7 @@ rec {
|
||||||
|
|
||||||
# Run an automated test suite in the given virtual network.
|
# Run an automated test suite in the given virtual network.
|
||||||
# `driver' is the script that runs the network.
|
# `driver' is the script that runs the network.
|
||||||
runTests = driver:
|
runTests = { driver, pos }:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "vm-test-run-${driver.testName}";
|
name = "vm-test-run-${driver.testName}";
|
||||||
|
|
||||||
|
@ -69,6 +69,8 @@ rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = driver.passthru;
|
passthru = driver.passthru;
|
||||||
|
|
||||||
|
inherit pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,6 +81,11 @@ rec {
|
||||||
# Skip linting (mainly intended for faster dev cycles)
|
# Skip linting (mainly intended for faster dev cycles)
|
||||||
, skipLint ? false
|
, skipLint ? false
|
||||||
, passthru ? {}
|
, passthru ? {}
|
||||||
|
, # For meta.position
|
||||||
|
pos ? # position used in error messages and for meta.position
|
||||||
|
(if t.meta.description or null != null
|
||||||
|
then builtins.unsafeGetAttrPos "description" t.meta
|
||||||
|
else builtins.unsafeGetAttrPos "testScript" t)
|
||||||
, ...
|
, ...
|
||||||
} @ t:
|
} @ t:
|
||||||
let
|
let
|
||||||
|
@ -174,7 +181,7 @@ rec {
|
||||||
driver = mkDriver null;
|
driver = mkDriver null;
|
||||||
driverInteractive = mkDriver pkgs.qemu;
|
driverInteractive = mkDriver pkgs.qemu;
|
||||||
|
|
||||||
test = passMeta (runTests driver);
|
test = passMeta (runTests { inherit driver pos; });
|
||||||
|
|
||||||
nodeNames = builtins.attrNames driver.nodes;
|
nodeNames = builtins.attrNames driver.nodes;
|
||||||
invalidNodeNames = lib.filter
|
invalidNodeNames = lib.filter
|
||||||
|
|
Loading…
Reference in New Issue