1{ system ? builtins.currentSystem, config ? { }
2, pkgs ? import ../.. { inherit system config; } }:
3
4with import ../lib/testing-python.nix { inherit system pkgs; };
5with pkgs.lib;
6
7let
8 matomoTest = package:
9 makeTest {
10 name = "matomo";
11
12 nodes.machine = { config, pkgs, ... }: {
13 services.matomo = {
14 package = package;
15 enable = true;
16 nginx = {
17 forceSSL = false;
18 enableACME = false;
19 };
20 };
21 services.mysql = {
22 enable = true;
23 package = pkgs.mariadb;
24 };
25 services.nginx.enable = true;
26 };
27
28 testScript = ''
29 start_all()
30 machine.wait_for_unit("mysql.service")
31 machine.wait_for_unit("phpfpm-matomo.service")
32 machine.wait_for_unit("nginx.service")
33
34 # without the grep the command does not produce valid utf-8 for some reason
35 with subtest("welcome screen loads"):
36 machine.succeed(
37 "curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'"
38 )
39 '';
40 };
41in {
42 matomo = matomoTest pkgs.matomo // {
43 name = "matomo";
44 meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
45 };
46 matomo-beta = matomoTest pkgs.matomo-beta // {
47 name = "matomo-beta";
48 meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ];
49 };
50}