tests: rework derivation stubbing
Instead of having to manually stub packages that should not be downloaded we instead automatically stub all packages (except a small list of whitelisted ones). Tests can re-introduce the real package by using the `realPkgs` module argument.
This commit is contained in:
parent
c5c2cbc866
commit
7a3f0b3b8d
480 changed files with 3557 additions and 5511 deletions
|
|
@ -1,12 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
programs.bash.enable = true;
|
||||
|
||||
test.stubs.bash-completion = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bashrc
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,21 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
|
||||
logoutExtra = ''
|
||||
clear-console
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bash_logout
|
||||
assertFileContent \
|
||||
home-files/.bash_logout \
|
||||
${
|
||||
builtins.toFile "logout-expected" ''
|
||||
clear-console
|
||||
''
|
||||
}
|
||||
logoutExtra = ''
|
||||
clear-console
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.bash_logout
|
||||
assertFileContent \
|
||||
home-files/.bash_logout \
|
||||
${
|
||||
builtins.toFile "logout-expected" ''
|
||||
clear-console
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,29 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = false;
|
||||
|
||||
sessionVariables = {
|
||||
V1 = "v1";
|
||||
V2 = "v2-${config.programs.bash.sessionVariables.V1}";
|
||||
};
|
||||
sessionVariables = {
|
||||
V1 = "v1";
|
||||
V2 = "v2-${config.programs.bash.sessionVariables.V1}";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.profile
|
||||
assertFileContent \
|
||||
home-files/.profile \
|
||||
${
|
||||
builtins.toFile "session-variables-expected" ''
|
||||
. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
export V1="v1"
|
||||
export V2="v2-v1"
|
||||
|
||||
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.profile
|
||||
assertFileContent \
|
||||
home-files/.profile \
|
||||
${
|
||||
builtins.toFile "session-variables-expected" ''
|
||||
. "/home/hm-user/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
export V1="v1"
|
||||
export V2="v2-v1"
|
||||
|
||||
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue