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-03-08 00:39:09 +01:00
|
|
|
, k8sVersion ? "1.13"
|
2019-05-03 23:25:49 +02:00
|
|
|
, nixosPath ? <nixpkgs/nixos>
|
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-03-08 00:39:09 +01:00
|
|
|
test = (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-03-12 20:33:56 +01:00
|
|
|
./k8s/submodule.nix
|
2019-04-05 20:27:47 +02:00
|
|
|
./k8s/imports.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-02-20 23:09:08 +01:00
|
|
|
];
|
2019-03-12 20:33:56 +01:00
|
|
|
testing.args = {
|
|
|
|
|
inherit images k8sVersion;
|
|
|
|
|
};
|
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;
|
|
|
|
|
in test.testing
|