tests: Refactor parts module

This commit is contained in:
SebastianStork 2026-02-14 23:53:12 +01:00
parent d92342ab4c
commit a3bae7baec
Signed by: SebastianStork
SSH key fingerprint: SHA256:iEM011ogNMG1q8+U500adGu/9rpPuZ2KnFtbdLeqTiI

View file

@ -2,18 +2,14 @@
{ {
perSystem = perSystem =
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ let
checks = mkTest = dir: rec {
"${self}/tests" name = "${dir}-test";
|> builtins.readDir
|> lib.attrNames
|> lib.map (name: {
name = "${name}-test";
value = pkgs.testers.runNixOSTest ( value = pkgs.testers.runNixOSTest (
{ {
name = "${name}-test"; inherit name;
} }
// import "${self}/tests/${name}" { // import "${self}/tests/${dir}" {
inherit inherit
inputs inputs
self self
@ -22,7 +18,9 @@
; ;
} }
); );
}) };
|> lib.listToAttrs; in
{
checks = "${self}/tests" |> builtins.readDir |> lib.attrNames |> lib.map mkTest |> lib.listToAttrs;
}; };
} }