2023-07-07 22:01:34 -04:00
|
|
|
{ system ? builtins.currentSystem, evalModules ? (import ../. { }).evalModules.${system} }:
|
|
|
|
|
{ k8sVersion ? "1.23"
|
|
|
|
|
, registry ? throw "Registry url not defined"
|
|
|
|
|
, doThrowError ? true
|
|
|
|
|
# whether any testing error should throw an error
|
|
|
|
|
, enabledTests ? null
|
|
|
|
|
}:
|
|
|
|
|
let
|
2022-04-02 14:42:22 -07:00
|
|
|
inherit
|
|
|
|
|
((evalModules {
|
2023-07-07 22:01:34 -04:00
|
|
|
module = { kubenix, pkgs, ... }: {
|
|
|
|
|
imports = [ kubenix.modules.testing ];
|
2021-05-28 20:26:17 -05:00
|
|
|
|
2020-04-05 21:25:34 +07:00
|
|
|
testing = {
|
2021-06-01 09:59:52 -05:00
|
|
|
inherit doThrowError enabledTests;
|
2020-04-05 21:25:34 +07:00
|
|
|
name = "kubenix-${k8sVersion}";
|
|
|
|
|
tests = [
|
|
|
|
|
./k8s/simple.nix
|
|
|
|
|
./k8s/deployment.nix
|
2022-04-02 16:12:17 -07:00
|
|
|
./k8s/crd.nix # flaky
|
2020-04-05 21:25:34 +07:00
|
|
|
./k8s/defaults.nix
|
|
|
|
|
./k8s/order.nix
|
|
|
|
|
./k8s/submodule.nix
|
2023-01-28 11:47:19 -05:00
|
|
|
# TODO: `importYaml` uses IFD which fails during `nix flake check` as it evaluates
|
|
|
|
|
# for all systems, not only the current one: https://github.com/hall/kubenix/issues/12
|
|
|
|
|
# ./k8s/imports.nix
|
2022-04-02 16:12:17 -07:00
|
|
|
#./helm/simple.nix
|
|
|
|
|
./istio/bookinfo.nix
|
2020-04-05 21:25:34 +07:00
|
|
|
./submodules/simple.nix
|
|
|
|
|
./submodules/defaults.nix
|
|
|
|
|
./submodules/versioning.nix
|
|
|
|
|
./submodules/exports.nix
|
|
|
|
|
./submodules/passthru.nix
|
|
|
|
|
];
|
2021-05-31 22:35:41 -05:00
|
|
|
|
2023-07-07 22:01:34 -04:00
|
|
|
args = { images = pkgs.callPackage ./images.nix { }; };
|
2021-05-28 20:26:17 -05:00
|
|
|
docker.registryUrl = registry;
|
2021-05-31 22:35:41 -05:00
|
|
|
|
2023-07-07 22:01:34 -04:00
|
|
|
common = [{
|
|
|
|
|
features = [ "k8s" ];
|
|
|
|
|
options = {
|
|
|
|
|
kubernetes.version = k8sVersion;
|
|
|
|
|
};
|
|
|
|
|
}];
|
2019-03-12 20:33:56 +01:00
|
|
|
};
|
2021-05-31 22:35:41 -05:00
|
|
|
};
|
2022-04-02 14:42:22 -07:00
|
|
|
}))
|
|
|
|
|
config
|
|
|
|
|
;
|
2021-05-13 17:27:08 -04:00
|
|
|
in
|
2023-07-07 22:01:34 -04:00
|
|
|
config.testing // { recurseForDerivations = true; }
|