From cf3aed2e829530e1139f7ba8c4b79d7e32313acb Mon Sep 17 00:00:00 2001 From: ibizaman Date: Tue, 7 Mar 2023 00:18:56 -0800 Subject: [PATCH] move unit tests under common directory --- default.nix | 2 -- docs/tutorials/unittests.md | 2 +- tests/default.nix | 8 ++------ tests/unit/default.nix | 9 +++++++++ tests/{ => unit}/haproxy.nix | 0 tests/{ => unit}/keycloak-cli-config.nix | 0 tests/{ => unit}/keycloak.nix | 0 7 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 tests/unit/default.nix rename tests/{ => unit}/haproxy.nix (100%) rename tests/{ => unit}/keycloak-cli-config.nix (100%) rename tests/{ => unit}/keycloak.nix (100%) diff --git a/default.nix b/default.nix index 2e0d0ef..67e44e2 100644 --- a/default.nix +++ b/default.nix @@ -23,6 +23,4 @@ rec { "no failing test" else concatStringsSep "\n" formattedFailureGroups; - - disnixtests = pkgs.callPackage ./tests/disnix/keycloak.nix {}; } diff --git a/docs/tutorials/unittests.md b/docs/tutorials/unittests.md index 5c8a632..fbf88ac 100644 --- a/docs/tutorials/unittests.md +++ b/docs/tutorials/unittests.md @@ -3,4 +3,4 @@ Unit tests are used in Self Host Blocks to check that parsing configurations produce the expected result. -You can find all unit tests under the [tests/](/tests/) directory. +You can find all unit tests under the [tests/unit](/tests/unit) directory. diff --git a/tests/default.nix b/tests/default.nix index da2cae0..a8b24a1 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,12 +1,8 @@ -# to run all tests: -# nix-instantiate --eval --strict . -A tests - { pkgs , utils }: { - haproxy = pkgs.callPackage ./haproxy.nix { inherit utils; }; - keycloak = pkgs.callPackage ./keycloak.nix {}; - keycloak-cli-config = pkgs.callPackage ./keycloak-cli-config.nix {}; + unit = pkgs.callPackage ./unit { inherit utils; }; + integration = pkgs.callPackage ./integration { inherit utils; }; } diff --git a/tests/unit/default.nix b/tests/unit/default.nix new file mode 100644 index 0000000..10c6d32 --- /dev/null +++ b/tests/unit/default.nix @@ -0,0 +1,9 @@ +{ pkgs +, utils +}: + +{ + haproxy = pkgs.callPackage ./haproxy.nix { inherit utils; }; + keycloak = pkgs.callPackage ./keycloak.nix {}; + keycloak-cli-config = pkgs.callPackage ./keycloak-cli-config.nix {}; +} diff --git a/tests/haproxy.nix b/tests/unit/haproxy.nix similarity index 100% rename from tests/haproxy.nix rename to tests/unit/haproxy.nix diff --git a/tests/keycloak-cli-config.nix b/tests/unit/keycloak-cli-config.nix similarity index 100% rename from tests/keycloak-cli-config.nix rename to tests/unit/keycloak-cli-config.nix diff --git a/tests/keycloak.nix b/tests/unit/keycloak.nix similarity index 100% rename from tests/keycloak.nix rename to tests/unit/keycloak.nix