Forked from Kiwi/gist:48e8160134ed08164923d32594dd3298
Last active
December 1, 2019 18:07
-
-
Save mmilata/a83d34417522f61c2dde33778e7a2065 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ system ? builtins.currentSystem, config ? { } | |
, pkgs ? import ../.. { inherit system config; } | |
, useBeta ? true }: | |
with import ../lib/testing-python.nix { inherit system pkgs; }; | |
with pkgs.lib; | |
makeTest { | |
name = "matomo${optionalString useBeta "-beta"}"; | |
meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ]; | |
machine = { config, pkgs, ... }: { | |
services.matomo = { | |
package = if useBeta then pkgs.matomo-beta else pkgs.matomo; | |
enable = true; | |
nginx = { | |
forceSSL = false; | |
enableACME = false; | |
}; | |
}; | |
services.mysql = { | |
enable = true; | |
package = pkgs.mysql; | |
}; | |
services.nginx.enable = true; | |
}; | |
testScript = '' | |
start_all() | |
machine.wait_for_unit("mysql.service") | |
machine.wait_for_unit("phpfpm-matomo.service") | |
machine.wait_for_unit("nginx.service") | |
# 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'" | |
) | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment