nixos/tests/prometheus: Use curl --fail

This commit is contained in:
Scott Worley 2020-09-15 15:34:42 -07:00 committed by Frederik Rietdijk
parent a91aa489a6
commit d2eec4bb11

View file

@ -193,13 +193,13 @@ in import ./make-test-python.nix {
# Check if prometheus responds to requests:
prometheus.wait_for_unit("prometheus.service")
prometheus.wait_for_open_port(${toString queryPort})
prometheus.succeed("curl -s http://127.0.0.1:${toString queryPort}/metrics")
prometheus.succeed("curl -sf http://127.0.0.1:${toString queryPort}/metrics")
# Let's test if pushing a metric to the pushgateway succeeds:
prometheus.wait_for_unit("pushgateway.service")
prometheus.succeed(
"echo 'some_metric 3.14' | "
+ "curl --data-binary \@- "
+ "curl -f --data-binary \@- "
+ "http://127.0.0.1:${toString pushgwPort}/metrics/job/some_job"
)