summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMartin Milata <martin@martinmilata.cz>2019-10-04 22:38:58 +0200
committerRobert Djubek <envy1988@gmail.com>2019-10-29 21:02:39 +0000
commit605379bc628f2fea85c144866d4bf8c2fe41ae33 (patch)
treef25f1d3703ac4aabb27dd1e5d066719199f55ff5 /nixos
parentcb85d27adc70dcab9138198109402fa69ff68eca (diff)
downloadnixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar.gz
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar.bz2
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar.lz
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar.xz
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.tar.zst
nixpkgs-605379bc628f2fea85c144866d4bf8c2fe41ae33.zip
nixos/matomo: add test
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/matomo.nix43
2 files changed, 44 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 10564e063c6..e9020531eb2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -158,6 +158,7 @@ in
   #logstash = handleTest ./logstash.nix {};
   mailcatcher = handleTest ./mailcatcher.nix {};
   mathics = handleTest ./mathics.nix {};
+  matomo = handleTest ./matomo.nix {};
   matrix-synapse = handleTest ./matrix-synapse.nix {};
   mediawiki = handleTest ./mediawiki.nix {};
   memcached = handleTest ./memcached.nix {};
diff --git a/nixos/tests/matomo.nix b/nixos/tests/matomo.nix
new file mode 100644
index 00000000000..4efa65a7b6d
--- /dev/null
+++ b/nixos/tests/matomo.nix
@@ -0,0 +1,43 @@
+{ system ? builtins.currentSystem, config ? { }
+, pkgs ? import ../.. { inherit system config; } }:
+
+with import ../lib/testing.nix { inherit system pkgs; };
+with pkgs.lib;
+
+let
+  matomoTest = package:
+  makeTest {
+    machine = { config, pkgs, ... }: {
+      services.matomo = {
+        package = package;
+        enable = true;
+        nginx = {
+          forceSSL = false;
+          enableACME = false;
+        };
+      };
+      services.mysql = {
+        enable = true;
+        package = pkgs.mysql;
+      };
+      services.nginx.enable = true;
+    };
+
+    testScript = ''
+      startAll;
+      $machine->waitForUnit("mysql.service");
+      $machine->waitForUnit("phpfpm-matomo.service");
+      $machine->waitForUnit("nginx.service");
+      $machine->succeed("curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'");
+    '';
+  };
+in {
+  matomo = matomoTest pkgs.matomo // {
+    name = "matomo";
+    meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
+  };
+  matomo-beta = matomoTest pkgs.matomo-beta // {
+    name = "matomo-beta";
+    meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
+  };
+}