git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/matomo: add test
commit605379bc628f2fea85c144866d4bf8c2fe41ae33 authorMartin Milata <martin@martinmilata.cz> dateFri 4 Oct 2019, 22:38 (7 years ago) parentcb85d27
2 files changed+44
nixos/tests/all-tests.nix+1 nixos/tests/matomo.nix+43
nixos/tests/all-tests.nix+1
@@ -158,6 +158,7 @@ in
158158 #logstash = handleTest ./logstash.nix {};
159159 mailcatcher = handleTest ./mailcatcher.nix {};
160160 mathics = handleTest ./mathics.nix {};
161+ matomo = handleTest ./matomo.nix {};
161162 matrix-synapse = handleTest ./matrix-synapse.nix {};
162163 mediawiki = handleTest ./mediawiki.nix {};
163164 memcached = handleTest ./memcached.nix {};
nixos/tests/matomo.nixnew file+43
@@ -0,0 +1,43 @@
1+{ system ? builtins.currentSystem, config ? { }
2+, pkgs ? import ../.. { inherit system config; } }:
3+
4+with import ../lib/testing.nix { inherit system pkgs; };
5+with pkgs.lib;
6+
7+let
8+ matomoTest = package:
9+ makeTest {
10+ machine = { config, pkgs, ... }: {
11+ services.matomo = {
12+ package = package;
13+ enable = true;
14+ nginx = {
15+ forceSSL = false;
16+ enableACME = false;
17+ };
18+ };
19+ services.mysql = {
20+ enable = true;
21+ package = pkgs.mysql;
22+ };
23+ services.nginx.enable = true;
24+ };
25+
26+ testScript = ''
27+ startAll;
28+ $machine->waitForUnit("mysql.service");
29+ $machine->waitForUnit("phpfpm-matomo.service");
30+ $machine->waitForUnit("nginx.service");
31+ $machine->succeed("curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'");
32+ '';
33+ };
34+in {
35+ matomo = matomoTest pkgs.matomo // {
36+ name = "matomo";
37+ meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
38+ };
39+ matomo-beta = matomoTest pkgs.matomo-beta // {
40+ name = "matomo-beta";
41+ meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
42+ };
43+}