feat: refactor testing

This commit is contained in:
Jaka Hudoklin 2019-02-25 17:16:24 +01:00
parent 937ce15748
commit 9bc2406ff2
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95
7 changed files with 158 additions and 163 deletions

View file

@ -10,6 +10,8 @@
with lib;
let
images = pkgs.callPackage ./images.nix {};
tests = listToAttrs (map (version: let
version' = replaceStrings ["."] ["_"] version;
in nameValuePair "v${version'}" (evalModules {
@ -28,11 +30,13 @@ let
./k8s/deployment.nix
./k8s/crd.nix
./k8s/1.13/crd.nix
./k8s/submodule.nix
./submodules/simple.nix
];
testing.defaults = ({kubenix, ...}: {
imports = [kubenix.k8s];
kubernetes.version = version;
_module.args.images = images;
});
}
];
@ -43,7 +47,4 @@ let
inherit kubenix;
};
}).config) k8sVersions);
in {
inherit tests;
results = mapAttrs (_: test: test.testing.result) tests;
}
in tests