mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Fixing up tests for shape and sublabel moving to topologies
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user