Skip to content

Commit 602525b

Browse files
committed
Test failed metrics
Fixes #4
1 parent b18aaf9 commit 602525b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/testinfra/test_metrics.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import pytest
22

3+
@pytest.mark.php_fpm
4+
def test_metric_fail_accepted_conn(host):
5+
cmd = host.run("php-fpm-healthcheck --accepted-conn=0")
6+
assert cmd.rc == 1
7+
assert "'accepted conn' value '1' is greater than expected '0'" in cmd.stderr
8+
9+
@pytest.mark.php_fpm
10+
def test_metric_fail_accepted_conn_with_other_metrics(host):
11+
cmd = host.run("php-fpm-healthcheck --verbose --listen-queue=10 --max-active-processes=10 --accepted-conn=0")
12+
assert cmd.rc == 1
13+
assert "'accepted conn' value '2' is greater than expected '0'" in cmd.stderr
14+
assert "'listen queue' value" in cmd.stdout
15+
assert "'max active processes' value" in cmd.stdout
16+
317
@pytest.mark.php_fpm
418
def test_metric_accepted_conn(host):
519
cmd = host.run("php-fpm-healthcheck -v")

0 commit comments

Comments
 (0)