]> git-server-git.apps.pok.os.sepia.ceph.com Git - cephmetrics.git/commitdiff
ceph-graphite: Fix test_metrics_present
authorZack Cerza <zack@redhat.com>
Thu, 29 Mar 2018 00:12:42 +0000 (18:12 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 17 Apr 2018 19:21:55 +0000 (13:21 -0600)
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 <zack@redhat.com>
ansible/roles/ceph-graphite/tests/test_graphite.py

index 512198781561ade4983bd5b787be0eee428e7d17..e15a7d3818e5c09b561973c3d2d75a22d225c8ea 100644 (file)
@@ -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)