mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-26 02:05:02 +00:00
nixos/test-driver: read test script from store instead of env var
The env var approach caps out at 128K which makes large test scripts fail checks with: ``` error: executing '.../bin/bash': Argument list too long ``` The script already exists in the store, let's use that.
This commit is contained in:
@@ -68,9 +68,11 @@ let
|
||||
++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.ty ]
|
||||
++ lib.optionals (!config.skipLint) [ hostPkgs.ruff ];
|
||||
buildInputs = [ testDriver ];
|
||||
testScript = config.testScriptString;
|
||||
preferLocalBuild = true;
|
||||
passthru = config.passthru;
|
||||
passthru = config.passthru // {
|
||||
# testScript used to be a part of the derivation attributes, kept for backwards compat.
|
||||
testScript = config.testScriptString;
|
||||
};
|
||||
meta = config.meta // {
|
||||
mainProgram = "nixos-test-driver";
|
||||
};
|
||||
@@ -82,7 +84,7 @@ let
|
||||
# prepend type hints so the test script can be type checked with ty
|
||||
cat "${../test-script-prepend.py}" >> testScriptWithTypes
|
||||
echo "${toString typeHints}" >> testScriptWithTypes
|
||||
echo -n "$testScript" >> testScriptWithTypes
|
||||
cat "${config.driverConfiguration.test_script}" >> testScriptWithTypes
|
||||
''}
|
||||
|
||||
${lib.optionalString (!config.skipTypeCheck) ''
|
||||
|
||||
Reference in New Issue
Block a user