Skip to content

Commit

Permalink
nixosTests.matomo: extend test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
osnyx committed Jan 15, 2025
1 parent 10f670a commit fc6d9cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nixos/tests/matomo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,25 @@ let
machine.wait_for_unit("phpfpm-matomo.service")
machine.wait_for_unit("nginx.service")
with subtest("matomo.js reachable via HTTP"):
machine.succeed("curl -sSfk http://machine/matomo.js")
with subtest("js/piwik.js reachable via HTTP"):
machine.succeed("curl -sSfk http://machine/js/piwik.js")
with subtest("matomo.php (API) reachable via HTTP"):
machine.succeed("curl -sSfk http://machine/matomo.php")
# 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'"
)
with subtest("killing the phpfpm process should trigger an automatic restart"):
machine.succeed("systemctl kill -s KILL phpfpm-matomo")
machine.sleep(1)
machine.wait_for_unit("phpfpm-matomo.service")
'';
};
in
Expand Down

0 comments on commit fc6d9cc

Please sign in to comment.