Compare commits

..

3 commits

Author SHA1 Message Date
fc4d569886 fixup! Add tests documentation to docs page
Some checks failed
CI / build (push) Failing after 45s
2025-03-24 21:50:44 +02:00
362fba1385 fixup! Add tests documentation to docs page
All checks were successful
CI / build (push) Successful in 2m42s
2025-03-24 17:28:43 +02:00
4f6fc5cec2 Add tests documentation to docs page
All checks were successful
CI / build (push) Successful in 2m27s
2025-03-24 15:35:23 +02:00
4 changed files with 7 additions and 11 deletions

View file

@ -4,7 +4,7 @@
pkgs,
deployPkgs,
...
}:
}@inputs:
{
${system} = {

View file

@ -54,7 +54,7 @@ let
in
pipe modulesBaseDir [
getSubDirs
(filter (isFolderWithFile "test.nix" modulesBaseDir))
(filter (isFolderWithFile "test.nix"))
(map mkTest)
(linkFarmFromDrvs "nixos-modules")
]

View file

@ -7,20 +7,16 @@ let
pathExists
path
;
# Get a list of all subdirectories of a directory.
getSubDirs = base: attrNames (filterAttrs (n: t: t == "directory") (builtins.readDir base));
# Check if a folder with a base path and folder name contains a file with a specific name
isFolderWithFile =
fileName: basePath: folderName:
(pathExists (path.append basePath "./${folderName}/${fileName}"));
# Get a list of subfolders that contain a default.nix file.
foldersWithNix = base: filter (isFolderWithFile "default.nix" base) (getSubDirs base);
(pathExists (path.append basePath "./${folderName}/${fileName}.nix"));
getSubDirs = base: attrNames (filterAttrs (n: t: t == "directory") (builtins.readDir base));
foldersWithNix = base: filter (isFolderWithFile "default.nix") (getSubDirs base);
in
{
inherit getSubDirs isFolderWithFile foldersWithNix;
inherit isFolderWithFile foldersWithNix;
# Get a list of default.nix files that are nix submodules of the current folder.
loadSubmodulesFrom =
basePath: map (folder: path.append basePath "./${folder}/default.nix") (foldersWithNix basePath);
}

View file

@ -37,7 +37,7 @@ def test(subtest, webserver):
expect_http_content(webserver, indexContent,
"http://localhost/index.html")
with subtest("example.com is a hosts alias and redirect"):
with subtest("example.com is a hosts alias and redirects to localhost"):
webserver.succeed("grep example.com /etc/hosts")
url = "http://example.com/index.html"