From b3f843afe29e3fbdc19c99f50ca6261878179d53 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 21 Aug 2017 16:30:09 -0400 Subject: [PATCH] Move internal/test package out of cli. Signed-off-by: Daniel Nephin --- cli/command/checkpoint/create_test.go | 2 +- cli/command/checkpoint/list_test.go | 2 +- cli/command/checkpoint/remove_test.go | 2 +- cli/command/config/create_test.go | 2 +- cli/command/config/inspect_test.go | 4 ++-- cli/command/config/ls_test.go | 4 ++-- cli/command/config/remove_test.go | 2 +- cli/command/container/attach_test.go | 2 +- cli/command/container/exec_test.go | 2 +- cli/command/idresolver/idresolver_test.go | 2 +- cli/command/image/build_test.go | 2 +- cli/command/image/history_test.go | 2 +- cli/command/image/import_test.go | 2 +- cli/command/image/inspect_test.go | 2 +- cli/command/image/list_test.go | 2 +- cli/command/image/load_test.go | 2 +- cli/command/image/prune_test.go | 2 +- cli/command/image/pull_test.go | 2 +- cli/command/image/push_test.go | 2 +- cli/command/image/remove_test.go | 2 +- cli/command/image/save_test.go | 2 +- cli/command/image/tag_test.go | 2 +- cli/command/network/connect_test.go | 2 +- cli/command/network/create_test.go | 2 +- cli/command/network/disconnect_test.go | 2 +- cli/command/node/demote_test.go | 4 ++-- cli/command/node/inspect_test.go | 4 ++-- cli/command/node/list_test.go | 4 ++-- cli/command/node/promote_test.go | 4 ++-- cli/command/node/ps_test.go | 4 ++-- cli/command/node/remove_test.go | 2 +- cli/command/node/update_test.go | 4 ++-- cli/command/registry_test.go | 4 ++-- cli/command/secret/create_test.go | 2 +- cli/command/secret/inspect_test.go | 4 ++-- cli/command/secret/ls_test.go | 4 ++-- cli/command/secret/remove_test.go | 2 +- cli/command/service/client_test.go | 2 +- cli/command/service/list_test.go | 2 +- cli/command/service/ps_test.go | 2 +- cli/command/service/rollback_test.go | 2 +- cli/command/stack/deploy_composefile_test.go | 2 +- cli/command/stack/deploy_test.go | 2 +- cli/command/stack/list_test.go | 4 ++-- cli/command/stack/ps_test.go | 4 ++-- cli/command/stack/remove_test.go | 2 +- cli/command/stack/services_test.go | 4 ++-- cli/command/swarm/ca_test.go | 2 +- cli/command/swarm/init_test.go | 2 +- cli/command/swarm/join_test.go | 2 +- cli/command/swarm/join_token_test.go | 4 ++-- cli/command/swarm/leave_test.go | 2 +- cli/command/swarm/unlock_key_test.go | 4 ++-- cli/command/swarm/unlock_test.go | 2 +- cli/command/swarm/update_test.go | 4 ++-- cli/command/system/prune_test.go | 2 +- cli/command/task/print_test.go | 4 ++-- cli/command/volume/create_test.go | 2 +- cli/command/volume/inspect_test.go | 4 ++-- cli/command/volume/list_test.go | 4 ++-- cli/command/volume/prune_test.go | 2 +- cli/command/volume/remove_test.go | 2 +- .../internal => internal}/test/builders/config.go | 0 {cli/internal => internal}/test/builders/doc.go | 0 {cli/internal => internal}/test/builders/node.go | 0 .../internal => internal}/test/builders/secret.go | 0 .../test/builders/service.go | 0 {cli/internal => internal}/test/builders/swarm.go | 0 {cli/internal => internal}/test/builders/task.go | 0 .../internal => internal}/test/builders/volume.go | 0 {cli/internal => internal}/test/cli.go | 0 {cli/internal => internal}/test/doc.go | 0 {cli/internal => internal}/test/network/client.go | 0 {cli/internal => internal}/test/store.go | 0 internal/test/testutil/assert.go | 15 +++++++++++++++ 75 files changed, 97 insertions(+), 82 deletions(-) rename {cli/internal => internal}/test/builders/config.go (100%) rename {cli/internal => internal}/test/builders/doc.go (100%) rename {cli/internal => internal}/test/builders/node.go (100%) rename {cli/internal => internal}/test/builders/secret.go (100%) rename {cli/internal => internal}/test/builders/service.go (100%) rename {cli/internal => internal}/test/builders/swarm.go (100%) rename {cli/internal => internal}/test/builders/task.go (100%) rename {cli/internal => internal}/test/builders/volume.go (100%) rename {cli/internal => internal}/test/cli.go (100%) rename {cli/internal => internal}/test/doc.go (100%) rename {cli/internal => internal}/test/network/client.go (100%) rename {cli/internal => internal}/test/store.go (100%) create mode 100644 internal/test/testutil/assert.go diff --git a/cli/command/checkpoint/create_test.go b/cli/command/checkpoint/create_test.go index 32c9d88a6..8aae6eba5 100644 --- a/cli/command/checkpoint/create_test.go +++ b/cli/command/checkpoint/create_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/checkpoint/list_test.go b/cli/command/checkpoint/list_test.go index 26dd963a8..dd934cd59 100644 --- a/cli/command/checkpoint/list_test.go +++ b/cli/command/checkpoint/list_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/checkpoint/remove_test.go b/cli/command/checkpoint/remove_test.go index 976aa0789..174a389ee 100644 --- a/cli/command/checkpoint/remove_test.go +++ b/cli/command/checkpoint/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/config/create_test.go b/cli/command/config/create_test.go index 7a6b2f54d..a5bdce2da 100644 --- a/cli/command/config/create_test.go +++ b/cli/command/config/create_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/config/inspect_test.go b/cli/command/config/inspect_test.go index 0431ffd65..320df70aa 100644 --- a/cli/command/config/inspect_test.go +++ b/cli/command/config/inspect_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/config/ls_test.go b/cli/command/config/ls_test.go index f58e815a5..dfe79dc3c 100644 --- a/cli/command/config/ls_test.go +++ b/cli/command/config/ls_test.go @@ -6,12 +6,12 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/config/remove_test.go b/cli/command/config/remove_test.go index 28cc41f67..2b7245167 100644 --- a/cli/command/config/remove_test.go +++ b/cli/command/config/remove_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/container/attach_test.go b/cli/command/container/attach_test.go index a33eeeeb5..e4caa473a 100644 --- a/cli/command/container/attach_test.go +++ b/cli/command/container/attach_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/container/exec_test.go b/cli/command/container/exec_test.go index 0eed2ff0f..acfe250d3 100644 --- a/cli/command/container/exec_test.go +++ b/cli/command/container/exec_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/idresolver/idresolver_test.go b/cli/command/idresolver/idresolver_test.go index f740c13ef..98bd306d1 100644 --- a/cli/command/idresolver/idresolver_test.go +++ b/cli/command/idresolver/idresolver_test.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types/swarm" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "golang.org/x/net/context" diff --git a/cli/command/image/build_test.go b/cli/command/image/build_test.go index 3664b91b7..325c82343 100644 --- a/cli/command/image/build_test.go +++ b/cli/command/image/build_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/archive" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/history_test.go b/cli/command/image/history_test.go index 7053735aa..c0a7ef313 100644 --- a/cli/command/image/history_test.go +++ b/cli/command/image/history_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/image" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/import_test.go b/cli/command/image/import_test.go index 87cc89693..0e45e7887 100644 --- a/cli/command/image/import_test.go +++ b/cli/command/image/import_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/image/inspect_test.go b/cli/command/image/inspect_test.go index 0bcb65836..d1de68561 100644 --- a/cli/command/image/inspect_test.go +++ b/cli/command/image/inspect_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/list_test.go b/cli/command/image/list_test.go index 58b7a71bd..9be4c379b 100644 --- a/cli/command/image/list_test.go +++ b/cli/command/image/list_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/load_test.go b/cli/command/image/load_test.go index bebe40cb0..d3002aa1c 100644 --- a/cli/command/image/load_test.go +++ b/cli/command/image/load_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/prune_test.go b/cli/command/image/prune_test.go index b52601608..90845e4bb 100644 --- a/cli/command/image/prune_test.go +++ b/cli/command/image/prune_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/image/pull_test.go b/cli/command/image/pull_test.go index 7b24cdbb0..57cd0ac77 100644 --- a/cli/command/image/pull_test.go +++ b/cli/command/image/pull_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/push_test.go b/cli/command/image/push_test.go index 1ead5b154..8f8b35d29 100644 --- a/cli/command/image/push_test.go +++ b/cli/command/image/push_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/image/remove_test.go b/cli/command/image/remove_test.go index a813f8f10..7bf0434d6 100644 --- a/cli/command/image/remove_test.go +++ b/cli/command/image/remove_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/image/save_test.go b/cli/command/image/save_test.go index 424c2c9a4..9e3ff147a 100644 --- a/cli/command/image/save_test.go +++ b/cli/command/image/save_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/image/tag_test.go b/cli/command/image/tag_test.go index c86bd22b3..bb0c71cae 100644 --- a/cli/command/image/tag_test.go +++ b/cli/command/image/tag_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/network/connect_test.go b/cli/command/network/connect_test.go index 577dd8c25..2343c7efb 100644 --- a/cli/command/network/connect_test.go +++ b/cli/command/network/connect_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/network" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" diff --git a/cli/command/network/create_test.go b/cli/command/network/create_test.go index 76c760d0a..b06febb4e 100644 --- a/cli/command/network/create_test.go +++ b/cli/command/network/create_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/network/disconnect_test.go b/cli/command/network/disconnect_test.go index 9b915a19b..04a5ab437 100644 --- a/cli/command/network/disconnect_test.go +++ b/cli/command/network/disconnect_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "golang.org/x/net/context" diff --git a/cli/command/node/demote_test.go b/cli/command/node/demote_test.go index d786cd47a..ccdbb5990 100644 --- a/cli/command/node/demote_test.go +++ b/cli/command/node/demote_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/inspect_test.go b/cli/command/node/inspect_test.go index b841b0639..1ce6ebd44 100644 --- a/cli/command/node/inspect_test.go +++ b/cli/command/node/inspect_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/node/list_test.go b/cli/command/node/list_test.go index fee29e284..b3a42df46 100644 --- a/cli/command/node/list_test.go +++ b/cli/command/node/list_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/promote_test.go b/cli/command/node/promote_test.go index 2399b2ee8..e0e228e86 100644 --- a/cli/command/node/promote_test.go +++ b/cli/command/node/promote_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/ps_test.go b/cli/command/node/ps_test.go index 8733e5e0f..836a130f7 100644 --- a/cli/command/node/ps_test.go +++ b/cli/command/node/ps_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/node/remove_test.go b/cli/command/node/remove_test.go index e0f3f238e..84d09c70e 100644 --- a/cli/command/node/remove_test.go +++ b/cli/command/node/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/node/update_test.go b/cli/command/node/update_test.go index 3abb720c1..4544cd12c 100644 --- a/cli/command/node/update_test.go +++ b/cli/command/node/update_test.go @@ -4,11 +4,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/registry_test.go b/cli/command/registry_test.go index 5e52e470a..3f3d5f579 100644 --- a/cli/command/registry_test.go +++ b/cli/command/registry_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "golang.org/x/net/context" - // Prevents a circular import with "github.com/docker/cli/cli/internal/test" + // Prevents a circular import with "github.com/docker/cli/internal/test" . "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) diff --git a/cli/command/secret/create_test.go b/cli/command/secret/create_test.go index 0887601ab..cc9eaa106 100644 --- a/cli/command/secret/create_test.go +++ b/cli/command/secret/create_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/secret/inspect_test.go b/cli/command/secret/inspect_test.go index eef789d80..4a38a18f5 100644 --- a/cli/command/secret/inspect_test.go +++ b/cli/command/secret/inspect_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/secret/ls_test.go b/cli/command/secret/ls_test.go index cced13610..af72effe9 100644 --- a/cli/command/secret/ls_test.go +++ b/cli/command/secret/ls_test.go @@ -7,12 +7,12 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/secret/remove_test.go b/cli/command/secret/remove_test.go index f3e427f7d..51622136a 100644 --- a/cli/command/secret/remove_test.go +++ b/cli/command/secret/remove_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/service/client_test.go b/cli/command/service/client_test.go index a886ff6a6..ebdfe7ea7 100644 --- a/cli/command/service/client_test.go +++ b/cli/command/service/client_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/client" "golang.org/x/net/context" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" ) type fakeClient struct { diff --git a/cli/command/service/list_test.go b/cli/command/service/list_test.go index 297f5f9b1..679c73370 100644 --- a/cli/command/service/list_test.go +++ b/cli/command/service/list_test.go @@ -3,7 +3,7 @@ package service import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/service/ps_test.go b/cli/command/service/ps_test.go index 083c58f91..1913202d3 100644 --- a/cli/command/service/ps_test.go +++ b/cli/command/service/ps_test.go @@ -3,7 +3,7 @@ package service import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/cli/opts" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" diff --git a/cli/command/service/rollback_test.go b/cli/command/service/rollback_test.go index 48be5076d..f4183dae2 100644 --- a/cli/command/service/rollback_test.go +++ b/cli/command/service/rollback_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/deploy_composefile_test.go b/cli/command/stack/deploy_composefile_test.go index 8d09ab056..28edb2c13 100644 --- a/cli/command/stack/deploy_composefile_test.go +++ b/cli/command/stack/deploy_composefile_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "github.com/docker/cli/cli/internal/test/network" + "github.com/docker/cli/internal/test/network" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/fs" diff --git a/cli/command/stack/deploy_test.go b/cli/command/stack/deploy_test.go index f91a825f9..f10fecd1a 100644 --- a/cli/command/stack/deploy_test.go +++ b/cli/command/stack/deploy_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/docker/cli/cli/compose/convert" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/stretchr/testify/assert" diff --git a/cli/command/stack/list_test.go b/cli/command/stack/list_test.go index 0ae5bc78c..f194d04fc 100644 --- a/cli/command/stack/list_test.go +++ b/cli/command/stack/list_test.go @@ -4,9 +4,9 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/ps_test.go b/cli/command/stack/ps_test.go index 249e1b656..b98c445f2 100644 --- a/cli/command/stack/ps_test.go +++ b/cli/command/stack/ps_test.go @@ -6,9 +6,9 @@ import ( "time" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/stack/remove_test.go b/cli/command/stack/remove_test.go index 88ad8a07d..c44977c0c 100644 --- a/cli/command/stack/remove_test.go +++ b/cli/command/stack/remove_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/stack/services_test.go b/cli/command/stack/services_test.go index fcc82ec88..d1d6c2408 100644 --- a/cli/command/stack/services_test.go +++ b/cli/command/stack/services_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/ca_test.go b/cli/command/swarm/ca_test.go index a1a77d59c..1271da127 100644 --- a/cli/command/swarm/ca_test.go +++ b/cli/command/swarm/ca_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/init_test.go b/cli/command/swarm/init_test.go index 5991c3dd5..24a1b9071 100644 --- a/cli/command/swarm/init_test.go +++ b/cli/command/swarm/init_test.go @@ -5,7 +5,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/swarm/join_test.go b/cli/command/swarm/join_test.go index d9f5215b7..ed8eff857 100644 --- a/cli/command/swarm/join_test.go +++ b/cli/command/swarm/join_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/join_token_test.go b/cli/command/swarm/join_token_test.go index da1b79532..89f7ab22b 100644 --- a/cli/command/swarm/join_token_test.go +++ b/cli/command/swarm/join_token_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/leave_test.go b/cli/command/swarm/leave_test.go index b5b672fe4..d2f5d57bb 100644 --- a/cli/command/swarm/leave_test.go +++ b/cli/command/swarm/leave_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/unlock_key_test.go b/cli/command/swarm/unlock_key_test.go index 0dc9fb5f0..e377e80c7 100644 --- a/cli/command/swarm/unlock_key_test.go +++ b/cli/command/swarm/unlock_key_test.go @@ -5,12 +5,12 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/swarm/unlock_test.go b/cli/command/swarm/unlock_test.go index 6663df1db..5151d6ba5 100644 --- a/cli/command/swarm/unlock_test.go +++ b/cli/command/swarm/unlock_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/swarm/update_test.go b/cli/command/swarm/update_test.go index 3c928a2e0..e1cd8d7c4 100644 --- a/cli/command/swarm/update_test.go +++ b/cli/command/swarm/update_test.go @@ -6,12 +6,12 @@ import ( "testing" "time" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/system/prune_test.go b/cli/command/system/prune_test.go index 669166c99..0d694ce06 100644 --- a/cli/command/system/prune_test.go +++ b/cli/command/system/prune_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/stretchr/testify/assert" ) diff --git a/cli/command/task/print_test.go b/cli/command/task/print_test.go index 19e02c6d1..04ae1bb0e 100644 --- a/cli/command/task/print_test.go +++ b/cli/command/task/print_test.go @@ -6,10 +6,10 @@ import ( "github.com/docker/cli/cli/command/formatter" "github.com/docker/cli/cli/command/idresolver" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "golang.org/x/net/context" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/gotestyourself/gotestyourself/golden" diff --git a/cli/command/volume/create_test.go b/cli/command/volume/create_test.go index cf84195f4..de534053b 100644 --- a/cli/command/volume/create_test.go +++ b/cli/command/volume/create_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" volumetypes "github.com/docker/docker/api/types/volume" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/volume/inspect_test.go b/cli/command/volume/inspect_test.go index fccccf444..57949305e 100644 --- a/cli/command/volume/inspect_test.go +++ b/cli/command/volume/inspect_test.go @@ -5,11 +5,11 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/volume/list_test.go b/cli/command/volume/list_test.go index 0eab71dc4..5f5654d5a 100644 --- a/cli/command/volume/list_test.go +++ b/cli/command/volume/list_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/docker/cli/cli/config/configfile" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" volumetypes "github.com/docker/docker/api/types/volume" "github.com/pkg/errors" // Import builders to get the builder function as package function - . "github.com/docker/cli/cli/internal/test/builders" + . "github.com/docker/cli/internal/test/builders" "github.com/docker/docker/pkg/testutil" "github.com/gotestyourself/gotestyourself/golden" "github.com/stretchr/testify/assert" diff --git a/cli/command/volume/prune_test.go b/cli/command/volume/prune_test.go index ccb5b15e3..788c02b34 100644 --- a/cli/command/volume/prune_test.go +++ b/cli/command/volume/prune_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/docker/cli/cli/command" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/pkg/testutil" diff --git a/cli/command/volume/remove_test.go b/cli/command/volume/remove_test.go index c10b18cc4..348714f4f 100644 --- a/cli/command/volume/remove_test.go +++ b/cli/command/volume/remove_test.go @@ -4,7 +4,7 @@ import ( "io/ioutil" "testing" - "github.com/docker/cli/cli/internal/test" + "github.com/docker/cli/internal/test" "github.com/docker/docker/pkg/testutil" "github.com/pkg/errors" "github.com/stretchr/testify/assert" diff --git a/cli/internal/test/builders/config.go b/internal/test/builders/config.go similarity index 100% rename from cli/internal/test/builders/config.go rename to internal/test/builders/config.go diff --git a/cli/internal/test/builders/doc.go b/internal/test/builders/doc.go similarity index 100% rename from cli/internal/test/builders/doc.go rename to internal/test/builders/doc.go diff --git a/cli/internal/test/builders/node.go b/internal/test/builders/node.go similarity index 100% rename from cli/internal/test/builders/node.go rename to internal/test/builders/node.go diff --git a/cli/internal/test/builders/secret.go b/internal/test/builders/secret.go similarity index 100% rename from cli/internal/test/builders/secret.go rename to internal/test/builders/secret.go diff --git a/cli/internal/test/builders/service.go b/internal/test/builders/service.go similarity index 100% rename from cli/internal/test/builders/service.go rename to internal/test/builders/service.go diff --git a/cli/internal/test/builders/swarm.go b/internal/test/builders/swarm.go similarity index 100% rename from cli/internal/test/builders/swarm.go rename to internal/test/builders/swarm.go diff --git a/cli/internal/test/builders/task.go b/internal/test/builders/task.go similarity index 100% rename from cli/internal/test/builders/task.go rename to internal/test/builders/task.go diff --git a/cli/internal/test/builders/volume.go b/internal/test/builders/volume.go similarity index 100% rename from cli/internal/test/builders/volume.go rename to internal/test/builders/volume.go diff --git a/cli/internal/test/cli.go b/internal/test/cli.go similarity index 100% rename from cli/internal/test/cli.go rename to internal/test/cli.go diff --git a/cli/internal/test/doc.go b/internal/test/doc.go similarity index 100% rename from cli/internal/test/doc.go rename to internal/test/doc.go diff --git a/cli/internal/test/network/client.go b/internal/test/network/client.go similarity index 100% rename from cli/internal/test/network/client.go rename to internal/test/network/client.go diff --git a/cli/internal/test/store.go b/internal/test/store.go similarity index 100% rename from cli/internal/test/store.go rename to internal/test/store.go diff --git a/internal/test/testutil/assert.go b/internal/test/testutil/assert.go new file mode 100644 index 000000000..cf5d2c987 --- /dev/null +++ b/internal/test/testutil/assert.go @@ -0,0 +1,15 @@ +package testutil + +import ( + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ErrorContains checks that the error is not nil, and contains the expected +// substring. +// TODO: replace with testify if https://github.com/stretchr/testify/pull/486 +// is accepted. +func ErrorContains(t require.TestingT, err error, expectedError string) { + require.Error(t, err) + assert.Contains(t, err.Error(), expectedError) +}