nixpkgs/nixos/tests/matomo.nix

80 lines
1.7 KiB
Nix
Raw Normal View History

{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}:
2019-10-04 22:38:58 +02:00
2019-12-01 00:50:55 +01:00
with import ../lib/testing-python.nix { inherit system pkgs; };
2019-10-04 22:38:58 +02:00
with pkgs.lib;
let
matomoTest =
package:
makeTest {
name = "matomo";
2022-06-26 00:14:38 +02:00
nodes.machine =
{ config, pkgs, ... }:
{
services.matomo = {
package = package;
enable = true;
nginx = {
forceSSL = false;
enableACME = false;
};
};
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
services.nginx.enable = true;
2019-10-04 22:38:58 +02:00
};
testScript = ''
start_all()
machine.wait_for_unit("mysql.service")
machine.wait_for_unit("phpfpm-matomo.service")
machine.wait_for_unit("nginx.service")
2019-12-01 00:50:55 +01:00
# without the grep the command does not produce valid utf-8 for some reason
with subtest("welcome screen loads"):
machine.succeed(
"curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'"
)
'';
};
in
{
2019-10-04 22:38:58 +02:00
matomo = matomoTest pkgs.matomo // {
name = "matomo";
meta.maintainers = with maintainers; [
florianjacob
mmilata
twey
boozedog
];
2019-10-04 22:38:58 +02:00
};
matomo-beta = matomoTest pkgs.matomo-beta // {
name = "matomo-beta";
meta.maintainers = with maintainers; [
florianjacob
mmilata
twey
boozedog
];
2019-10-04 22:38:58 +02:00
};
2024-01-11 08:33:36 +01:00
matomo_5 = matomoTest pkgs.matomo_5 // {
name = "matomo-5";
meta.maintainers =
with maintainers;
[
florianjacob
mmilata
twey
boozedog
]
++ lib.teams.flyingcircus.members;
2024-01-11 08:33:36 +01:00
};
2019-10-04 22:38:58 +02:00
}