From 930f1a78baa8a3e4796a6d0afc2a4db01eccd76f Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 28 Mar 2018 18:12:42 -0600 Subject: [PATCH] ceph-graphite: Fix test_metrics_present If a cluster changes over time, the test broke. When looking at stored metrics, assert that our inventory hosts are a subset of the stored metrics as opposed to doing an equality check. Signed-off-by: Zack Cerza --- ansible/roles/ceph-graphite/tests/test_graphite.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ansible/roles/ceph-graphite/tests/test_graphite.py b/ansible/roles/ceph-graphite/tests/test_graphite.py index 5121987..e15a7d3 100644 --- a/ansible/roles/ceph-graphite/tests/test_graphite.py +++ b/ansible/roles/ceph-graphite/tests/test_graphite.py @@ -90,6 +90,5 @@ class TestGraphite(object): def extract_hostname(fragment): return fragment['text'] - metric_hosts = map(extract_hostname, obj) - assert sorted(map(lambda s: s.split('.')[0], ceph_hosts)) == \ - sorted(metric_hosts) + metric_hosts = set(map(extract_hostname, obj)) + assert set(map(lambda s: s.split('.')[0], ceph_hosts)).issubset(metric_hosts) -- 2.47.3