about summary refs log tree commit diff
path: root/postgres-smoke-test.nix
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2023-07-22 13:17:56 +0300
committerVika <vika@fireburn.ru>2023-07-22 13:41:09 +0300
commit50c8f7d8f5f04c717ef4e72d873bf994c03efda0 (patch)
tree98609e2bdb43823d24ca03b96d9c37d2ec34ad02 /postgres-smoke-test.nix
parent827aa789dab67eba2d117298cac60f3f1ea2c7e4 (diff)
Move NixOS tests to a separate folder to prevent clutter
Diffstat (limited to 'postgres-smoke-test.nix')
-rw-r--r--postgres-smoke-test.nix49
1 files changed, 0 insertions, 49 deletions
diff --git a/postgres-smoke-test.nix b/postgres-smoke-test.nix
deleted file mode 100644
index 51d53c7..0000000
--- a/postgres-smoke-test.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-kittybox:
-{ lib, ... }: {
-  name = "nixos-kittybox";
-
-  nodes = {
-    kittybox = { config, pkgs, lib, ... }: {
-      imports = [ kittybox.nixosModules.default ];
-
-      services.postgresql = {
-        enable = true;
-        ensureDatabases = ["kittybox"];
-        ensureUsers = [ {
-          name = "kittybox";
-          ensurePermissions = {
-            "DATABASE kittybox" = "ALL PRIVILEGES";
-          };
-        } ];
-      };
-
-      services.kittybox = {
-        enable = true;
-        logLevel = "info,kittybox=debug,retainer::cache=warn,h2=warn,rustls=warn";
-        backendUri = "postgres://localhost?host=/run/postgresql&dbname=kittybox";
-      };
-
-      systemd.services.kittybox.wants = [ "postgresql.service" ];
-      systemd.services.kittybox.after = [ "postgresql.service" ];
-
-      environment.systemPackages = with pkgs; [
-        xh
-      ];
-    };
-  };
-
-  # TODO: Make e2e tests for authentication endpoints and such
-  # Potentially using WebDriver
-  # Could also be implemented with fantoccini
-  testScript = ''
-    with subtest("Verify that Kittybox started correctly..."):
-        kittybox.wait_for_open_port(8080)
-        kittybox.succeed("xh --no-check-status http://localhost:8080/.kittybox/micropub")
-
-    with subtest("Onboarding should correctly work..."):
-        kittybox.copy_from_host("${./onboarding.json}", "/root/onboarding.json")
-        kittybox.succeed("xh --follow http://localhost:8080/.kittybox/onboarding -j @/root/onboarding.json")
-        # Testing for a known string is the easiest way to determine that the onboarding worked
-        kittybox.succeed("xh http://localhost:8080/ | grep 'vestige of the past long gone'")
-'';
-}