1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 19:15:39 +00:00

nixos/matomo: add test

This commit is contained in:
Martin Milata 2019-10-04 22:38:58 +02:00 committed by Robert Djubek
parent cb85d27adc
commit 605379bc62
No known key found for this signature in database
GPG key ID: 156C88A5B0A04B2A
2 changed files with 44 additions and 0 deletions

View file

@ -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 {};

43
nixos/tests/matomo.nix Normal file
View file

@ -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 ];
};
}