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,41 +1,32 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config = {
|
||||
programs.taskwarrior = {
|
||||
enable = true;
|
||||
package = pkgs.taskwarrior3;
|
||||
colorTheme = "dark-violets-256";
|
||||
dataLocation = "/some/data/location";
|
||||
config = {
|
||||
urgency.user.tag.next.coefficient = 42.42;
|
||||
urgency.blocked.coefficient = -42;
|
||||
};
|
||||
extraConfig = ''
|
||||
include /my/stuff
|
||||
urgency.user.tag.test.coefficient=-42.42
|
||||
'';
|
||||
programs.taskwarrior = {
|
||||
enable = true;
|
||||
colorTheme = "dark-violets-256";
|
||||
dataLocation = "/some/data/location";
|
||||
config = {
|
||||
urgency.user.tag.next.coefficient = 42.42;
|
||||
urgency.blocked.coefficient = -42;
|
||||
};
|
||||
|
||||
test.stubs.taskwarrior3 = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/task/home-manager-taskrc
|
||||
assertFileContent home-files/.config/task/home-manager-taskrc ${
|
||||
pkgs.writeText "taskwarrior.home-conf.expected" ''
|
||||
data.location=/some/data/location
|
||||
include dark-violets-256.theme
|
||||
|
||||
urgency.blocked.coefficient=-42
|
||||
urgency.user.tag.next.coefficient=42.420000
|
||||
|
||||
include /my/stuff
|
||||
urgency.user.tag.test.coefficient=-42.42
|
||||
|
||||
''
|
||||
}
|
||||
extraConfig = ''
|
||||
include /my/stuff
|
||||
urgency.user.tag.test.coefficient=-42.42
|
||||
'';
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/task/home-manager-taskrc
|
||||
assertFileContent home-files/.config/task/home-manager-taskrc ${
|
||||
builtins.toFile "taskwarrior.home-conf.expected" ''
|
||||
data.location=/some/data/location
|
||||
include dark-violets-256.theme
|
||||
|
||||
urgency.blocked.coefficient=-42
|
||||
urgency.user.tag.next.coefficient=42.420000
|
||||
|
||||
include /my/stuff
|
||||
urgency.user.tag.test.coefficient=-42.42
|
||||
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue