mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
fmt
This commit is contained in:
parent
a0ce293db8
commit
60592d3096
55 changed files with 23668 additions and 30925 deletions
|
|
@ -1,7 +1,11 @@
|
|||
{ lib, config, testing, kubenix, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
testing,
|
||||
kubenix,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
modules = [
|
||||
# testing module
|
||||
config.module
|
||||
|
|
@ -13,10 +17,12 @@ let
|
|||
{
|
||||
config = {
|
||||
kubenix.project = mkDefault config.name;
|
||||
_module.args = {
|
||||
inherit kubenix;
|
||||
test = evaled.config;
|
||||
} // testing.args;
|
||||
_module.args =
|
||||
{
|
||||
inherit kubenix;
|
||||
test = evaled.config;
|
||||
}
|
||||
// testing.args;
|
||||
};
|
||||
}
|
||||
];
|
||||
|
|
@ -36,28 +42,29 @@ let
|
|||
# common options that can be applied on this test
|
||||
commonOpts =
|
||||
filter
|
||||
(d:
|
||||
(intersectLists d.features testFeatures) == d.features ||
|
||||
(length d.features) == 0
|
||||
)
|
||||
testing.common;
|
||||
(
|
||||
d:
|
||||
(intersectLists d.features testFeatures)
|
||||
== d.features
|
||||
|| (length d.features) == 0
|
||||
)
|
||||
testing.common;
|
||||
|
||||
# add common options modules to all modules
|
||||
modulesWithCommonOptions = modules ++ (map (d: d.options) commonOpts);
|
||||
|
||||
# evaled test
|
||||
evaled =
|
||||
let
|
||||
evaled' = kubenix.evalModules {
|
||||
modules = modulesWithCommonOptions;
|
||||
};
|
||||
in
|
||||
if testing.doThrowError then evaled'
|
||||
evaled = let
|
||||
evaled' = kubenix.evalModules {
|
||||
modules = modulesWithCommonOptions;
|
||||
};
|
||||
in
|
||||
if testing.doThrowError
|
||||
then evaled'
|
||||
else if (builtins.tryEval evaled'.config.test.assertions).success
|
||||
then evaled' else null;
|
||||
|
||||
in
|
||||
{
|
||||
then evaled'
|
||||
else null;
|
||||
in {
|
||||
options = {
|
||||
module = mkOption {
|
||||
description = "Module defining kubenix test";
|
||||
|
|
@ -100,7 +107,7 @@ in
|
|||
description = "Test result";
|
||||
type = types.unspecified;
|
||||
internal = true;
|
||||
default = [ ];
|
||||
default = [];
|
||||
};
|
||||
|
||||
script = mkOption {
|
||||
|
|
@ -108,7 +115,6 @@ in
|
|||
type = types.nullOr (types.either types.lines types.path);
|
||||
internal = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue