mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2026-02-02 03:05:09 +01:00
31 lines
721 B
Nix
31 lines
721 B
Nix
|
|
{
|
||
|
|
pkgs,
|
||
|
|
ntlib,
|
||
|
|
system,
|
||
|
|
nixlets,
|
||
|
|
...
|
||
|
|
}: {
|
||
|
|
suites."Render Tests" = {
|
||
|
|
pos = __curPos;
|
||
|
|
tests = builtins.map (
|
||
|
|
nixlet: {
|
||
|
|
name = "render ${nixlet.name}";
|
||
|
|
type = "script";
|
||
|
|
script = let
|
||
|
|
output = nixlet.render {inherit system;};
|
||
|
|
in
|
||
|
|
# sh
|
||
|
|
''
|
||
|
|
${ntlib.helpers.path [pkgs.gnugrep]}
|
||
|
|
${ntlib.helpers.scriptHelpers}
|
||
|
|
|
||
|
|
assert "-f ${output}" "should render"
|
||
|
|
assert_file_contains "${output}" "apiVersion"
|
||
|
|
assert_file_contains "${output}" "kubenix/k8s-version"
|
||
|
|
assert_file_contains "${output}" "kubenix/project-name"
|
||
|
|
'';
|
||
|
|
}
|
||
|
|
) (builtins.attrValues nixlets);
|
||
|
|
};
|
||
|
|
}
|