at 25.11-pre 1.4 kB view raw
1import ./make-test-python.nix ( 2 { pkgs, ... }: 3 { 4 name = "trickster"; 5 meta = with pkgs.lib; { 6 maintainers = with maintainers; [ _1000101 ]; 7 }; 8 9 nodes = { 10 prometheus = 11 { ... }: 12 { 13 services.prometheus.enable = true; 14 networking.firewall.allowedTCPPorts = [ 9090 ]; 15 }; 16 trickster = 17 { ... }: 18 { 19 services.trickster.enable = true; 20 }; 21 }; 22 23 testScript = '' 24 start_all() 25 prometheus.wait_for_unit("prometheus.service") 26 prometheus.wait_for_open_port(9090) 27 prometheus.wait_until_succeeds( 28 "curl -fL http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'" 29 ) 30 trickster.wait_for_unit("trickster.service") 31 trickster.wait_for_open_port(8082) 32 trickster.wait_for_open_port(9090) 33 trickster.wait_until_succeeds( 34 "curl -fL http://localhost:8082/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'" 35 ) 36 trickster.wait_until_succeeds( 37 "curl -fL http://prometheus:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'" 38 ) 39 trickster.wait_until_succeeds( 40 "curl -fL http://localhost:9090/metrics | grep 'promhttp_metric_handler_requests_total{code=\"500\"} 0'" 41 ) 42 ''; 43 } 44)