at 24.11-pre 776 B view raw
1import ./make-test-python.nix ({ pkgs, ... }: let 2 testPort = 8108; 3in { 4 name = "typesense"; 5 meta.maintainers = with pkgs.lib.maintainers; [ oddlama ]; 6 7 nodes.machine = { ... }: { 8 services.typesense = { 9 enable = true; 10 apiKeyFile = pkgs.writeText "typesense-api-key" "dummy"; 11 settings.server = { 12 api-port = testPort; 13 api-address = "0.0.0.0"; 14 }; 15 }; 16 }; 17 18 testScript = '' 19 machine.wait_for_unit("typesense.service") 20 machine.wait_for_open_port(${toString testPort}) 21 # After waiting for the port, typesense still hasn't initialized the database, so wait until we can connect successfully 22 assert machine.wait_until_succeeds("curl --fail http://localhost:${toString testPort}/health") == '{"ok":true}' 23 ''; 24})