mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
tests: Refactor parts module
This commit is contained in:
parent
d92342ab4c
commit
a3bae7baec
1 changed files with 19 additions and 21 deletions
|
|
@ -2,27 +2,25 @@
|
||||||
{
|
{
|
||||||
perSystem =
|
perSystem =
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
mkTest = dir: rec {
|
||||||
|
name = "${dir}-test";
|
||||||
|
value = pkgs.testers.runNixOSTest (
|
||||||
|
{
|
||||||
|
inherit name;
|
||||||
|
}
|
||||||
|
// import "${self}/tests/${dir}" {
|
||||||
|
inherit
|
||||||
|
inputs
|
||||||
|
self
|
||||||
|
pkgs
|
||||||
|
lib
|
||||||
|
;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
checks =
|
checks = "${self}/tests" |> builtins.readDir |> lib.attrNames |> lib.map mkTest |> lib.listToAttrs;
|
||||||
"${self}/tests"
|
|
||||||
|> builtins.readDir
|
|
||||||
|> lib.attrNames
|
|
||||||
|> lib.map (name: {
|
|
||||||
name = "${name}-test";
|
|
||||||
value = pkgs.testers.runNixOSTest (
|
|
||||||
{
|
|
||||||
name = "${name}-test";
|
|
||||||
}
|
|
||||||
// import "${self}/tests/${name}" {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
self
|
|
||||||
pkgs
|
|
||||||
lib
|
|
||||||
;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})
|
|
||||||
|> lib.listToAttrs;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue