style: simplify example & tests top level invokation

This commit is contained in:
David Arnold 2021-05-31 22:35:41 -05:00
parent 0c99276b50
commit 557cc48a0a
No known key found for this signature in database
GPG key ID: 6D6A936E69C59D08
2 changed files with 31 additions and 20 deletions

View file

@ -3,20 +3,32 @@
let
# evaluated configuration
config = (evalModules {
modules = [
({ kubenix, ... }: { imports = [ kubenix.modules.testing ]; })
module =
{ kubenix, ... }: {
imports = [
kubenix.modules.testing
./module.nix
{ docker.registry.url = registry; }
{
testing.tests = [ ./test.nix ];
testing.docker.registryUrl = "";
}
];
# commonalities
kubenix.project = "nginx-deployment-example";
docker.registry.url = registry;
kubernetes.version = "1.21";
testing = {
tests = [ ./test.nix ];
docker.registryUrl = "";
# testing commonalities for tests that exhibit the respective feature
defaults = [
{
features = [ "k8s" ];
default = {
kubernetes.version = "1.20";
};
}
];
};
};
}).config;
in

View file

@ -11,11 +11,11 @@
let
config = (evalModules {
modules = [
module =
{ kubenix, pkgs, ... }: {
({ kubenix, ... }: { imports = [ kubenix.modules.testing ]; })
imports = [ kubenix.modules.testing ];
({ pkgs, ... }: {
testing = {
name = "kubenix-${k8sVersion}";
throwError = throwError;
@ -36,10 +36,10 @@ let
./submodules/exports.nix
./submodules/passthru.nix
];
args = {
images = pkgs.callPackage ./images.nix { };
};
args = { images = pkgs.callPackage ./images.nix { }; };
docker.registryUrl = registry;
defaults = [
{
features = [ "k8s" ];
@ -49,9 +49,8 @@ let
}
];
};
})
];
};
}).config;
in