@@ -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+}