]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REGTESTS: promex: Adapt script to be less verbose
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Feb 2024 13:20:00 +0000 (14:20 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 2 Feb 2024 08:11:34 +0000 (09:11 +0100)
First, checks on the resolver scope were added. Then, because of the recent
changes, the logs emitted by vtest are now too big and this makes the script
fails. So tests on NaN values are now performed on a smaller request. This
reduces enough the logs to pass.

In fact some checks were removed

reg-tests/contrib/prometheus.vtc

index a481240248b85a26dc8fd617d91c0b0f17efa9d3..60217c2a0ea9d046e4d472edf7e65d84c6fa2bbb 100644 (file)
@@ -1,6 +1,6 @@
 varnishtest "prometheus exporter test"
 
-#REQUIRE_VERSION=2.4
+#REQUIRE_VERSION=3.0
 #REQUIRE_SERVICES=prometheus-exporter
 
 feature ignore_unknown_macro
@@ -39,9 +39,9 @@ haproxy h1 -conf {
 } -start
 
 client c1 -connect ${h1_stats_sock} {
+       # test general metrics
        txreq -url "/metrics"
        rxresp
-       # test general metrics
        expect resp.status == 200
        expect resp.body ~ ".*haproxy_process.*"
        expect resp.body ~ ".*haproxy_frontend.*"
@@ -49,8 +49,20 @@ client c1 -connect ${h1_stats_sock} {
        expect resp.body ~ ".*haproxy_backend.*"
        expect resp.body ~ ".*haproxy_server.*"
        expect resp.body ~ ".*haproxy_sticktable.*"
+       expect resp.body ~ ".*haproxy_resolver.*"
+
+       # test well known labels presence
+       expect resp.body ~ ".*haproxy_process_build_info{version=\".*\"} 1.*"
+       expect resp.body ~ ".*haproxy_frontend_http_responses_total{proxy=\"stats\",code=\"4xx\"} 0.*"
+       expect resp.body ~ ".*haproxy_frontend_status{proxy=\"fe\",state=\"UP\"} 1.*"
+       expect resp.body ~ ".*haproxy_listener_status{proxy=\"stats\",listener=\"sock-1\",state=\"WAITING\"} 0.*"
+       expect resp.body ~ ".*haproxy_backend_status{proxy=\"be\",state=\"UP\"} 1.*"
+       expect resp.body ~ ".*haproxy_server_status{proxy=\"be\",server=\"s1\",state=\"DOWN\"} 0.*"
+       expect resp.body ~ ".*haproxy_server_check_status{proxy=\"be\",server=\"s2\",state=\"HANA\"} 0.*"
 
        # test expected NaN values
+       txreq -url "/metrics?scope=backend&scope=server"
+       rxresp
        expect resp.body ~ ".*haproxy_server_check_failures_total{proxy=\"be\",server=\"s1\"} NaN.*"
        expect resp.body ~ ".*haproxy_server_check_up_down_total{proxy=\"be\",server=\"s1\"} NaN.*"
        expect resp.body ~ ".*haproxy_server_check_failures_total{proxy=\"be\",server=\"s2\"} 0.*"
@@ -72,15 +84,6 @@ client c1 -connect ${h1_stats_sock} {
        expect resp.body ~ ".*haproxy_server_idle_connections_limit{proxy=\"be\",server=\"s1\"} NaN.*"
        expect resp.body ~ ".*haproxy_server_idle_connections_limit{proxy=\"be\",server=\"s2\"} 42.*"
 
-       # test well known labels presence
-       expect resp.body ~ ".*haproxy_process_build_info{version=\".*\"} 1.*"
-       expect resp.body ~ ".*haproxy_frontend_http_responses_total{proxy=\"stats\",code=\"4xx\"} 0.*"
-       expect resp.body ~ ".*haproxy_frontend_status{proxy=\"fe\",state=\"UP\"} 1.*"
-       expect resp.body ~ ".*haproxy_listener_status{proxy=\"stats\",listener=\"sock-1\",state=\"WAITING\"} 0.*"
-       expect resp.body ~ ".*haproxy_backend_status{proxy=\"be\",state=\"UP\"} 1.*"
-       expect resp.body ~ ".*haproxy_server_status{proxy=\"be\",server=\"s1\",state=\"DOWN\"} 0.*"
-       expect resp.body ~ ".*haproxy_server_check_status{proxy=\"be\",server=\"s2\",state=\"HANA\"} 0.*"
-
        # test scope
        txreq -url "/metrics?scope="
        rxresp
@@ -96,6 +99,7 @@ client c1 -connect ${h1_stats_sock} {
        expect resp.body !~ ".*haproxy_backend.*"
        expect resp.body ~ ".*haproxy_server.*"
        expect resp.body !~ ".*haproxy_sticktable.*"
+       expect resp.body !~ ".*haproxy_resolver.*"
 
        txreq -url "/metrics?scope=frontend&scope=backend"
        rxresp
@@ -106,6 +110,7 @@ client c1 -connect ${h1_stats_sock} {
        expect resp.body ~ ".*haproxy_backend.*"
        expect resp.body !~ ".*haproxy_server.*"
        expect resp.body !~ ".*haproxy_sticktable.*"
+       expect resp.body !~ ".*haproxy_resolver.*"
 
        txreq -url "/metrics?scope"
        rxresp