From 1a38436ef8747fafc16f281d47a7a7b259ce4586 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Tue, 6 Dec 2016 18:10:08 +0000 Subject: [PATCH] Use test.Diff from common --- app/collector_test.go | 2 +- app/merger_test.go | 2 +- app/router_test.go | 2 +- common/weave/client_test.go | 2 +- probe/appclient/app_client_internal_test.go | 2 +- probe/controls/controls_test.go | 2 +- probe/docker/controls_test.go | 3 ++- probe/docker/registry_test.go | 3 ++- probe/endpoint/nat_internal_test.go | 2 +- probe/endpoint/procspy/spy_linux_internal_test.go | 2 +- probe/plugins/registry_internal_test.go | 2 +- probe/process/walker_linux_test.go | 2 +- probe/process/walker_test.go | 2 +- render/container_test.go | 2 +- render/detailed/metadata_test.go | 2 +- render/detailed/metrics_test.go | 2 +- render/detailed/node_test.go | 2 +- render/detailed/parents_test.go | 2 +- render/detailed/summary_test.go | 2 +- render/detailed/tables_test.go | 2 +- render/detailed/topology_diff_test.go | 2 +- render/filters_test.go | 2 +- render/host_test.go | 2 +- render/memoise_test.go | 2 +- render/metrics_test.go | 2 +- render/pod_test.go | 2 +- render/process_test.go | 2 +- render/render_test.go | 2 +- render/theinternet_test.go | 2 +- report/counters_internal_test.go | 2 +- report/edge_metadatas_internal_test.go | 2 +- report/latest_map_internal_test.go | 2 +- report/metrics_test.go | 2 +- report/networks_test.go | 2 +- report/node_test.go | 2 +- report/report_test.go | 2 +- report/table_test.go | 2 +- 37 files changed, 39 insertions(+), 37 deletions(-) diff --git a/app/collector_test.go b/app/collector_test.go index 86a9169f0d..6491cf740f 100644 --- a/app/collector_test.go +++ b/app/collector_test.go @@ -7,9 +7,9 @@ import ( "golang.org/x/net/context" "github.com/weaveworks/common/mtime" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/app" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/app/merger_test.go b/app/merger_test.go index 574d673c62..6328cf2dfd 100644 --- a/app/merger_test.go +++ b/app/merger_test.go @@ -5,9 +5,9 @@ import ( "math/rand" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/app" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/app/router_test.go b/app/router_test.go index 37980f37be..57a68e3c8f 100644 --- a/app/router_test.go +++ b/app/router_test.go @@ -13,8 +13,8 @@ import ( "github.com/ugorji/go/codec" "golang.org/x/net/context" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/app" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" ) diff --git a/common/weave/client_test.go b/common/weave/client_test.go index 91abe03ada..57c26fa6a1 100644 --- a/common/weave/client_test.go +++ b/common/weave/client_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/weaveworks/common/exec" + "github.com/weaveworks/common/test" testExec "github.com/weaveworks/common/test/exec" "github.com/weaveworks/scope/common/weave" - "github.com/weaveworks/scope/test" ) const ( diff --git a/probe/appclient/app_client_internal_test.go b/probe/appclient/app_client_internal_test.go index 79df715e22..73edd40747 100644 --- a/probe/appclient/app_client_internal_test.go +++ b/probe/appclient/app_client_internal_test.go @@ -13,9 +13,9 @@ import ( "github.com/gorilla/handlers" "github.com/ugorji/go/codec" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/common/xfer" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" ) func dummyServer(t *testing.T, expectedToken, expectedID string, expectedVersion string, expectedReport report.Report, done chan struct{}) *httptest.Server { diff --git a/probe/controls/controls_test.go b/probe/controls/controls_test.go index 7bdf226906..aa869a1796 100644 --- a/probe/controls/controls_test.go +++ b/probe/controls/controls_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/common/xfer" "github.com/weaveworks/scope/probe/controls" - "github.com/weaveworks/scope/test" ) func TestControls(t *testing.T) { diff --git a/probe/docker/controls_test.go b/probe/docker/controls_test.go index cb0490e1d8..855ea326d3 100644 --- a/probe/docker/controls_test.go +++ b/probe/docker/controls_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + commonTest "github.com/weaveworks/common/test" "github.com/weaveworks/scope/common/xfer" "github.com/weaveworks/scope/probe/controls" "github.com/weaveworks/scope/probe/docker" @@ -92,7 +93,7 @@ func TestPipes(t *testing.T) { NodeID: report.MakeContainerNodeID("ping"), }) if !reflect.DeepEqual(result, want.response) { - t.Errorf("diff %s: %s", want.control, test.Diff(want, result)) + t.Errorf("diff %s: %s", want.control, commonTest.Diff(want, result)) } } }) diff --git a/probe/docker/registry_test.go b/probe/docker/registry_test.go index 6f5da8aa5a..2f110b5e72 100644 --- a/probe/docker/registry_test.go +++ b/probe/docker/registry_test.go @@ -12,6 +12,7 @@ import ( client "github.com/fsouza/go-dockerclient" "github.com/weaveworks/common/mtime" + commonTest "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/controls" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/report" @@ -496,7 +497,7 @@ func TestRegistryDelete(t *testing.T) { }), } if !reflect.DeepEqual(want, nodes) { - t.Errorf("Didn't get right container updates: %v", test.Diff(want, nodes)) + t.Errorf("Didn't get right container updates: %v", commonTest.Diff(want, nodes)) } nodes = []report.Node{} mtx.Unlock() diff --git a/probe/endpoint/nat_internal_test.go b/probe/endpoint/nat_internal_test.go index 3e0e7383b3..67440126fc 100644 --- a/probe/endpoint/nat_internal_test.go +++ b/probe/endpoint/nat_internal_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/weaveworks/common/mtime" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/probe/endpoint/procspy/spy_linux_internal_test.go b/probe/endpoint/procspy/spy_linux_internal_test.go index 21af2b7c91..6f658c6f7a 100644 --- a/probe/endpoint/procspy/spy_linux_internal_test.go +++ b/probe/endpoint/procspy/spy_linux_internal_test.go @@ -7,8 +7,8 @@ import ( "time" fs_hook "github.com/weaveworks/common/fs" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/process" - "github.com/weaveworks/scope/test" ) func TestLinuxConnections(t *testing.T) { diff --git a/probe/plugins/registry_internal_test.go b/probe/plugins/registry_internal_test.go index 0344d8367b..2a433bb2db 100644 --- a/probe/plugins/registry_internal_test.go +++ b/probe/plugins/registry_internal_test.go @@ -19,11 +19,11 @@ import ( "github.com/ugorji/go/codec" fs_hook "github.com/weaveworks/common/fs" + "github.com/weaveworks/common/test" "github.com/weaveworks/common/test/fs" "github.com/weaveworks/scope/common/xfer" "github.com/weaveworks/scope/probe/controls" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/probe/process/walker_linux_test.go b/probe/process/walker_linux_test.go index b3e90fafb6..68912aed0d 100644 --- a/probe/process/walker_linux_test.go +++ b/probe/process/walker_linux_test.go @@ -5,9 +5,9 @@ import ( "testing" fs_hook "github.com/weaveworks/common/fs" + "github.com/weaveworks/common/test" "github.com/weaveworks/common/test/fs" "github.com/weaveworks/scope/probe/process" - "github.com/weaveworks/scope/test" ) var mockFS = fs.Dir("", diff --git a/probe/process/walker_test.go b/probe/process/walker_test.go index de54061909..c1287a0e2f 100644 --- a/probe/process/walker_test.go +++ b/probe/process/walker_test.go @@ -4,8 +4,8 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/process" - "github.com/weaveworks/scope/test" ) func TestBasicWalk(t *testing.T) { diff --git a/render/container_test.go b/render/container_test.go index 97aee4bd34..5eb3fb2fdc 100644 --- a/render/container_test.go +++ b/render/container_test.go @@ -5,12 +5,12 @@ import ( "net" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/probe/process" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/render/expected" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/detailed/metadata_test.go b/render/detailed/metadata_test.go index 38a9fc5974..7698e96936 100644 --- a/render/detailed/metadata_test.go +++ b/render/detailed/metadata_test.go @@ -4,10 +4,10 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" ) diff --git a/render/detailed/metrics_test.go b/render/detailed/metrics_test.go index 22c12f2a68..6444afc17e 100644 --- a/render/detailed/metrics_test.go +++ b/render/detailed/metrics_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/probe/host" "github.com/weaveworks/scope/probe/process" "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" ) diff --git a/render/detailed/node_test.go b/render/detailed/node_test.go index a4a3d74986..7ea17631dc 100644 --- a/render/detailed/node_test.go +++ b/render/detailed/node_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/probe/host" "github.com/weaveworks/scope/probe/kubernetes" @@ -12,7 +13,6 @@ import ( "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/render/expected" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/detailed/parents_test.go b/render/detailed/parents_test.go index 7a265587fb..6cc79b0b29 100644 --- a/render/detailed/parents_test.go +++ b/render/detailed/parents_test.go @@ -4,11 +4,11 @@ import ( "fmt" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/render/expected" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/detailed/summary_test.go b/render/detailed/summary_test.go index ba866c16c8..e4a5ad72d7 100644 --- a/render/detailed/summary_test.go +++ b/render/detailed/summary_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/weaveworks/common/mtime" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/probe/host" "github.com/weaveworks/scope/probe/process" @@ -13,7 +14,6 @@ import ( "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/render/expected" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/detailed/tables_test.go b/render/detailed/tables_test.go index 17c4c6b3d9..02f723391f 100644 --- a/render/detailed/tables_test.go +++ b/render/detailed/tables_test.go @@ -4,10 +4,10 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/docker" "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" ) diff --git a/render/detailed/topology_diff_test.go b/render/detailed/topology_diff_test.go index 93e21c2cdb..35bfdf9e6c 100644 --- a/render/detailed/topology_diff_test.go +++ b/render/detailed/topology_diff_test.go @@ -5,9 +5,9 @@ import ( "sort" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render/detailed" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" ) // ByID is a sort interface for a NodeSummary slice. diff --git a/render/filters_test.go b/render/filters_test.go index 7f6d86472e..3b83d6862e 100644 --- a/render/filters_test.go +++ b/render/filters_test.go @@ -3,9 +3,9 @@ package render_test import ( "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/host_test.go b/render/host_test.go index 2cd1dd8317..a4e2447728 100644 --- a/render/host_test.go +++ b/render/host_test.go @@ -3,9 +3,9 @@ package render_test import ( "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/render/expected" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/memoise_test.go b/render/memoise_test.go index 22347307b5..677ca252ad 100644 --- a/render/memoise_test.go +++ b/render/memoise_test.go @@ -3,9 +3,9 @@ package render_test import ( "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/metrics_test.go b/render/metrics_test.go index ef5be6ffb9..58106f288d 100644 --- a/render/metrics_test.go +++ b/render/metrics_test.go @@ -4,9 +4,9 @@ import ( "testing" "time" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/pod_test.go b/render/pod_test.go index 396d1b15a8..75a02b6d21 100644 --- a/render/pod_test.go +++ b/render/pod_test.go @@ -3,10 +3,10 @@ package render_test import ( "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/kubernetes" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/render/expected" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/process_test.go b/render/process_test.go index 3c76cb0c12..7881b6bc22 100644 --- a/render/process_test.go +++ b/render/process_test.go @@ -3,9 +3,9 @@ package render_test import ( "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/render/expected" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/fixture" "github.com/weaveworks/scope/test/reflect" ) diff --git a/render/render_test.go b/render/render_test.go index 5164a290d4..d334cc3d55 100644 --- a/render/render_test.go +++ b/render/render_test.go @@ -4,9 +4,9 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" ) type mockRenderer struct { diff --git a/render/theinternet_test.go b/render/theinternet_test.go index 36c8147b66..fabf2335f3 100644 --- a/render/theinternet_test.go +++ b/render/theinternet_test.go @@ -5,10 +5,10 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/probe/host" "github.com/weaveworks/scope/render" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" ) func TestReportLocalNetworks(t *testing.T) { diff --git a/report/counters_internal_test.go b/report/counters_internal_test.go index 0f912aebbe..237a963003 100644 --- a/report/counters_internal_test.go +++ b/report/counters_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/ugorji/go/codec" - "github.com/weaveworks/scope/test" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/edge_metadatas_internal_test.go b/report/edge_metadatas_internal_test.go index 9106a705e9..4a63a4643a 100644 --- a/report/edge_metadatas_internal_test.go +++ b/report/edge_metadatas_internal_test.go @@ -6,7 +6,7 @@ import ( "github.com/ugorji/go/codec" - "github.com/weaveworks/scope/test" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/latest_map_internal_test.go b/report/latest_map_internal_test.go index 286b265b0d..16c1cfddcb 100644 --- a/report/latest_map_internal_test.go +++ b/report/latest_map_internal_test.go @@ -8,7 +8,7 @@ import ( "github.com/ugorji/go/codec" - "github.com/weaveworks/scope/test" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/metrics_test.go b/report/metrics_test.go index a6f1763b23..a725c44616 100644 --- a/report/metrics_test.go +++ b/report/metrics_test.go @@ -7,8 +7,8 @@ import ( "github.com/ugorji/go/codec" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/networks_test.go b/report/networks_test.go index 74a33a9f57..a199fcf828 100644 --- a/report/networks_test.go +++ b/report/networks_test.go @@ -4,8 +4,8 @@ import ( "net" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/node_test.go b/report/node_test.go index 1c5f89ab44..f1f2c15ceb 100644 --- a/report/node_test.go +++ b/report/node_test.go @@ -5,8 +5,8 @@ import ( "time" "github.com/weaveworks/common/mtime" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/report_test.go b/report/report_test.go index fa5b5f5616..cf7e78508f 100644 --- a/report/report_test.go +++ b/report/report_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/weaveworks/common/mtime" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" s_reflect "github.com/weaveworks/scope/test/reflect" ) diff --git a/report/table_test.go b/report/table_test.go index e7dedf0002..72b6d94cd4 100644 --- a/report/table_test.go +++ b/report/table_test.go @@ -5,8 +5,8 @@ import ( "reflect" "testing" + "github.com/weaveworks/common/test" "github.com/weaveworks/scope/report" - "github.com/weaveworks/scope/test" ) func TestPrefixTables(t *testing.T) {