Fixing up tests for shape and sublabel moving to topologies

This commit is contained in:
Paul Bellamy
2016-04-20 13:24:32 +01:00
parent 4bd3832219
commit 99c611f594
2 changed files with 16 additions and 8 deletions

View File

@@ -68,6 +68,14 @@ func TestAppClientPublish(t *testing.T) {
// marshalling->unmarshaling is not idempotent due to `json:"omitempty"`
// tags, transforming empty slices into nils. So, we make DeepEqual
// happy by setting empty `json:"omitempty"` entries to nil
rpt.Endpoint = report.MakeTopology()
rpt.Process = report.MakeTopology()
rpt.Container = report.MakeTopology()
rpt.ContainerImage = report.MakeTopology()
rpt.Pod = report.MakeTopology()
rpt.Service = report.MakeTopology()
rpt.Host = report.MakeTopology()
rpt.Overlay = report.MakeTopology()
rpt.Endpoint.Controls = nil
rpt.Process.Controls = nil
rpt.Container.Controls = nil

View File

@@ -80,14 +80,6 @@ func TestProbe(t *testing.T) {
want := report.MakeReport()
node := report.MakeNodeWith("a", map[string]string{"b": "c"})
node.Metrics = nil // omitempty
want.Endpoint.AddNode(node)
want.Probes[probeID] = report.Probe{
ID: probeID,
LastSeen: now,
}
pub := mockPublisher{make(chan report.Report)}
// omitempty
want.Endpoint.Controls = nil
want.Process.Controls = nil
@@ -98,6 +90,14 @@ func TestProbe(t *testing.T) {
want.Host.Controls = nil
want.Overlay.Controls = nil
want.Endpoint.AddNode(node)
want.Probes[probeID] = report.Probe{
ID: probeID,
LastSeen: now,
}
pub := mockPublisher{make(chan report.Report)}
p := New(probeID, 10*time.Millisecond, 100*time.Millisecond, pub)
p.AddReporter(mockReporter{want})
p.Start()