From 7d10986f10251bb77f7e52f5e54604b32a621cf3 Mon Sep 17 00:00:00 2001 From: Sergio Jimenez Date: Thu, 11 Feb 2016 00:57:36 +0100 Subject: [PATCH] test(unit): Test for whitelisted metrics --- plugins/inputs/mesos/mesos_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/inputs/mesos/mesos_test.go b/plugins/inputs/mesos/mesos_test.go index 6b0a1beae..297e0d2b8 100644 --- a/plugins/inputs/mesos/mesos_test.go +++ b/plugins/inputs/mesos/mesos_test.go @@ -75,6 +75,7 @@ func TestMesosMaster(t *testing.T) { m := Mesos{ Servers: []string{ts.Listener.Addr().String()}, + Timeout: 10, } err := m.Gather(&acc) @@ -108,6 +109,13 @@ func TestRemoveGroup(t *testing.T) { } } } + for _, v := range m.MetricsCol { + for _, x := range masterBlocks(v) { + if _, ok := mesosMetrics[x]; !ok { + t.Errorf("Didn't find key %s, it should present.", x) + } + } + } } func TestMasterBlocks(t *testing.T) {