mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-23 22:36:24 +00:00
Trim whitespace from process names
This causes detailed node lookups for the grouped-by-process-name view to fail. Also, add a test for process walker trimmming whitespace, and a test the process-by-name view gives the right result.
This commit is contained in:
@@ -43,14 +43,14 @@ func TestAPITopologyApplications(t *testing.T) {
|
||||
// Let's not unit-test the specific content of the detail tables
|
||||
}
|
||||
{
|
||||
body := getRawJSON(t, ts, fmt.Sprintf("/api/topology/applications/%s/%s", expected.ClientProcessID, expected.ServerProcessID))
|
||||
body := getRawJSON(t, ts, fmt.Sprintf("/api/topology/applications/%s/%s", expected.ClientProcess1ID, expected.ServerProcessID))
|
||||
var edge APIEdge
|
||||
if err := json.Unmarshal(body, &edge); err != nil {
|
||||
t.Fatalf("JSON parse error: %s", err)
|
||||
}
|
||||
want := render.AggregateMetadata{
|
||||
"egress_bytes": 30,
|
||||
"ingress_bytes": 300,
|
||||
"egress_bytes": 10,
|
||||
"ingress_bytes": 100,
|
||||
}
|
||||
if !reflect.DeepEqual(want, edge.Metadata) {
|
||||
t.Error("\n" + test.Diff(want, edge.Metadata))
|
||||
@@ -129,7 +129,7 @@ func TestAPITopologyWebsocket(t *testing.T) {
|
||||
if err := json.Unmarshal(p, &d); err != nil {
|
||||
t.Fatalf("JSON parse error: %s", err)
|
||||
}
|
||||
equals(t, 5, len(d.Add))
|
||||
equals(t, 6, len(d.Add))
|
||||
equals(t, 0, len(d.Update))
|
||||
equals(t, 0, len(d.Remove))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user