2019-02-12 16:22:18 +01:00
|
|
|
{ pkgs ? import <nixpkgs> {}
|
2019-03-07 18:02:26 +01:00
|
|
|
, lib ? pkgs.lib
|
|
|
|
|
, kubenix ? import ../. { inherit pkgs lib; }
|
2019-02-16 14:02:13 +01:00
|
|
|
, k8sVersions ? ["1.7" "1.8" "1.9" "1.10" "1.11" "1.12" "1.13"]
|
2019-02-12 16:22:18 +01:00
|
|
|
|
|
|
|
|
# whether any testing error should throw an error
|
2019-02-20 23:09:08 +01:00
|
|
|
, throwError ? true
|
|
|
|
|
, e2e ? true }:
|
2019-02-12 16:22:18 +01:00
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
2019-02-20 23:09:08 +01:00
|
|
|
let
|
2019-02-25 17:16:24 +01:00
|
|
|
images = pkgs.callPackage ./images.nix {};
|
|
|
|
|
|
2019-02-20 23:09:08 +01:00
|
|
|
tests = listToAttrs (map (version: let
|
|
|
|
|
version' = replaceStrings ["."] ["_"] version;
|
2019-03-07 18:02:26 +01:00
|
|
|
in nameValuePair "v${version'}" (kubenix.evalModules {
|
2019-02-20 23:09:08 +01:00
|
|
|
modules = [
|
2019-03-07 23:23:07 +01:00
|
|
|
kubenix.modules.testing
|
2019-02-12 16:22:18 +01:00
|
|
|
|
2019-02-20 23:09:08 +01:00
|
|
|
{
|
|
|
|
|
testing.throwError = throwError;
|
|
|
|
|
testing.e2e = e2e;
|
|
|
|
|
testing.tests = [
|
|
|
|
|
./k8s/simple.nix
|
|
|
|
|
./k8s/deployment.nix
|
|
|
|
|
./k8s/crd.nix
|
|
|
|
|
./k8s/1.13/crd.nix
|
2019-02-27 12:06:18 +01:00
|
|
|
./k8s/defaults.nix
|
2019-02-28 14:04:47 +01:00
|
|
|
./k8s/order.nix
|
2019-02-28 13:17:40 +01:00
|
|
|
./helm/simple.nix
|
2019-02-27 14:18:38 +01:00
|
|
|
./istio/bookinfo.nix
|
2019-02-20 23:09:08 +01:00
|
|
|
./submodules/simple.nix
|
2019-02-26 21:23:14 +01:00
|
|
|
./submodules/defaults.nix
|
2019-03-01 17:49:37 +01:00
|
|
|
./submodules/versioning.nix
|
2019-03-07 11:41:43 +01:00
|
|
|
./module.nix
|
2019-02-20 23:09:08 +01:00
|
|
|
];
|
|
|
|
|
testing.defaults = ({kubenix, ...}: {
|
2019-03-07 23:23:07 +01:00
|
|
|
imports = [kubenix.modules.k8s];
|
2019-02-20 23:09:08 +01:00
|
|
|
kubernetes.version = version;
|
2019-02-25 17:16:24 +01:00
|
|
|
_module.args.images = images;
|
2019-02-20 23:09:08 +01:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
args = {
|
|
|
|
|
inherit pkgs;
|
|
|
|
|
};
|
|
|
|
|
specialArgs = {
|
|
|
|
|
inherit kubenix;
|
|
|
|
|
};
|
|
|
|
|
}).config) k8sVersions);
|
2019-02-25 17:16:24 +01:00
|
|
|
in tests
|