2021-05-13 17:27:08 -04:00
|
|
|
{ pkgs ? import <nixpkgs> { }
|
2019-03-07 18:02:26 +01:00
|
|
|
, lib ? pkgs.lib
|
|
|
|
|
, kubenix ? import ../. { inherit pkgs lib; }
|
2020-04-05 21:25:34 +07:00
|
|
|
|
2019-05-05 11:55:19 +02:00
|
|
|
, nixosPath ? toString <nixpkgs/nixos>
|
2019-02-12 16:22:18 +01:00
|
|
|
|
2021-05-06 16:07:24 -04:00
|
|
|
, k8sVersion ? "1.21"
|
2020-04-05 21:25:34 +07:00
|
|
|
, registryUrl ? throw "Registry url not defined"
|
|
|
|
|
, throwError ? true # whether any testing error should throw an error
|
2021-05-13 17:27:08 -04:00
|
|
|
, enabledTests ? null
|
|
|
|
|
}:
|
2019-02-12 16:22:18 +01:00
|
|
|
|
|
|
|
|
with lib;
|
2019-02-20 23:09:08 +01:00
|
|
|
let
|
2021-05-13 17:27:08 -04:00
|
|
|
images = pkgs.callPackage ./images.nix { };
|
2019-02-25 17:16:24 +01:00
|
|
|
|
2020-04-05 21:25:34 +07:00
|
|
|
config = (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
|
|
|
{
|
2020-04-05 21:25:34 +07:00
|
|
|
testing = {
|
|
|
|
|
name = "kubenix-${k8sVersion}";
|
|
|
|
|
throwError = throwError;
|
|
|
|
|
enabledTests = enabledTests;
|
|
|
|
|
tests = [
|
|
|
|
|
./k8s/simple.nix
|
|
|
|
|
./k8s/deployment.nix
|
|
|
|
|
# ./k8s/crd.nix # flaky
|
|
|
|
|
./k8s/defaults.nix
|
|
|
|
|
./k8s/order.nix
|
|
|
|
|
./k8s/submodule.nix
|
|
|
|
|
./k8s/imports.nix
|
2021-05-13 17:27:08 -04:00
|
|
|
# ./helm/simple.nix
|
2020-04-05 21:25:34 +07:00
|
|
|
# ./istio/bookinfo.nix # infinite recursion
|
|
|
|
|
./submodules/simple.nix
|
|
|
|
|
./submodules/defaults.nix
|
|
|
|
|
./submodules/versioning.nix
|
|
|
|
|
./submodules/exports.nix
|
|
|
|
|
./submodules/passthru.nix
|
|
|
|
|
];
|
|
|
|
|
args = {
|
|
|
|
|
inherit images;
|
|
|
|
|
};
|
|
|
|
|
docker.registryUrl = registryUrl;
|
|
|
|
|
defaults = [
|
|
|
|
|
{
|
2021-05-13 17:27:08 -04:00
|
|
|
features = [ "k8s" ];
|
2020-04-05 21:25:34 +07:00
|
|
|
default = {
|
|
|
|
|
kubernetes.version = k8sVersion;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
];
|
2019-03-12 20:33:56 +01:00
|
|
|
};
|
2019-02-20 23:09:08 +01:00
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
args = {
|
|
|
|
|
inherit pkgs;
|
|
|
|
|
};
|
|
|
|
|
specialArgs = {
|
2019-05-03 23:25:49 +02:00
|
|
|
inherit kubenix nixosPath;
|
2019-02-20 23:09:08 +01:00
|
|
|
};
|
2019-03-08 00:39:09 +01:00
|
|
|
}).config;
|
2021-05-13 17:27:08 -04:00
|
|
|
in
|
|
|
|
|
pkgs.recurseIntoAttrs config.testing
|