1 { system ? builtins.currentSystem
3 , pkgs ? import ../../.. { inherit system config; }
6 with import ../../lib/testing-python.nix { inherit system pkgs; };
11 inherit (import ./common.nix { inherit system; }) baseConfig;
14 inherit (pkgs) hydra_unstable;
17 makeHydraTest = with pkgs.lib; name: package: makeTest {
18 name = "hydra-${name}";
19 meta = with pkgs.lib.maintainers; {
20 maintainers = [ lewo ma27 ];
23 nodes.machine = { pkgs, lib, ... }: {
24 imports = [ baseConfig ];
25 services.hydra = { inherit package; };
29 # let the system boot up
30 machine.wait_for_unit("multi-user.target")
31 # test whether the database is running
32 machine.wait_for_unit("postgresql.service")
33 # test whether the actual hydra daemons are running
34 machine.wait_for_unit("hydra-init.service")
35 machine.require_unit_state("hydra-queue-runner.service")
36 machine.require_unit_state("hydra-evaluator.service")
37 machine.require_unit_state("hydra-notify.service")
39 machine.succeed("hydra-create-user admin --role admin --password admin")
41 # create a project with a trivial job
42 machine.wait_for_open_port(3000)
44 # make sure the build as been successfully built
45 machine.succeed("create-trivial-project.sh")
47 machine.wait_until_succeeds(
48 'curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq'
51 machine.wait_until_succeeds(
52 'journalctl -eu hydra-notify.service -o cat | grep -q "sending mail notification to hydra@localhost"'
59 mapAttrs makeHydraTest hydraPkgs