at 24.11-pre 1.7 kB view raw
1import ../make-test-python.nix ({ pkgs, lib, ... }: 2let 3 domain = "sourcehut.localdomain"; 4in 5{ 6 name = "sourcehut"; 7 8 meta.maintainers = with pkgs.lib.maintainers; [ tomberek nessdoor ]; 9 10 nodes.machine = { config, pkgs, nodes, ... }: { 11 imports = [ 12 ./nodes/common.nix 13 ]; 14 15 networking.domain = domain; 16 networking.extraHosts = '' 17 ${config.networking.primaryIPAddress} builds.${domain} 18 ${config.networking.primaryIPAddress} meta.${domain} 19 ''; 20 21 services.sourcehut = { 22 builds = { 23 enable = true; 24 # FIXME: see why it does not seem to activate fully. 25 #enableWorker = true; 26 images = { }; 27 }; 28 29 settings."builds.sr.ht" = { 30 oauth-client-secret = pkgs.writeText "buildsrht-oauth-client-secret" "2260e9c4d9b8dcedcef642860e0504bc"; 31 oauth-client-id = "299db9f9c2013170"; 32 }; 33 }; 34 }; 35 36 testScript = '' 37 start_all() 38 machine.wait_for_unit("multi-user.target") 39 40 with subtest("Check whether meta comes up"): 41 machine.wait_for_unit("metasrht-api.service") 42 machine.wait_for_unit("metasrht.service") 43 machine.wait_for_unit("metasrht-webhooks.service") 44 machine.wait_for_open_port(5000) 45 machine.succeed("curl -sL http://localhost:5000 | grep meta.${domain}") 46 machine.succeed("curl -sL http://meta.${domain} | grep meta.${domain}") 47 48 with subtest("Check whether builds comes up"): 49 machine.wait_for_unit("buildsrht.service") 50 machine.wait_for_open_port(5002) 51 machine.succeed("curl -sL http://localhost:5002 | grep builds.${domain}") 52 #machine.wait_for_unit("buildsrht-worker.service") 53 ''; 54})