at master 1.3 kB view raw
1{ pkgs, ... }: 2let 3 inherit (import ./common.nix) baseConfig; 4in 5{ 6 name = "hydra"; 7 meta = with pkgs.lib.maintainers; { 8 maintainers = [ lewo ]; 9 }; 10 11 nodes.machine = 12 { pkgs, lib, ... }: 13 { 14 imports = [ baseConfig ]; 15 }; 16 17 testScript = '' 18 # let the system boot up 19 machine.wait_for_unit("multi-user.target") 20 # test whether the database is running 21 machine.wait_for_unit("postgresql.target") 22 # test whether the actual hydra daemons are running 23 machine.wait_for_unit("hydra-init.service") 24 machine.require_unit_state("hydra-queue-runner.service") 25 machine.require_unit_state("hydra-evaluator.service") 26 machine.require_unit_state("hydra-notify.service") 27 28 machine.succeed("hydra-create-user admin --role admin --password admin") 29 30 # create a project with a trivial job 31 machine.wait_for_open_port(3000) 32 33 # make sure the build as been successfully built 34 machine.succeed("create-trivial-project.sh") 35 36 machine.wait_until_succeeds( 37 'curl -L -s http://localhost:3000/build/1 -H "Accept: application/json" | jq .buildstatus | xargs test 0 -eq' 38 ) 39 40 machine.wait_until_succeeds( 41 'journalctl -eu hydra-notify.service -o cat | grep -q "sending mail notification to hydra@localhost"' 42 ) 43 ''; 44}