mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat: initial testing support
This commit is contained in:
parent
e286c9b0e8
commit
9f8ca8447e
6 changed files with 362 additions and 127 deletions
41
test/modules/test.nix
Normal file
41
test/modules/test.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
options.test = {
|
||||
name = mkOption {
|
||||
description = "Test name";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
description = mkOption {
|
||||
description = "Test description";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
assertions = mkOption {
|
||||
type = types.listOf (types.submodule {
|
||||
options = {
|
||||
assertion = mkOption {
|
||||
description = "assertion value";
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
message = mkOption {
|
||||
description = "assertion message";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = [];
|
||||
example = [ { assertion = false; message = "you can't enable this for that reason"; } ];
|
||||
description = ''
|
||||
This option allows modules to express conditions that must
|
||||
hold for the evaluation of the system configuration to
|
||||
succeed, along with associated error messages for the user.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue