diff --git a/TESTING.md b/TESTING.md index 1231e1c5f4d91baf4bd55e906d229d4fcd77bbfc..34ad843638b658ded0ab851636e2a25305cb2c22 100644 --- a/TESTING.md +++ b/TESTING.md @@ -8,11 +8,11 @@ questions you may have as an aspiring Moby contributor. Moby has two test suites (and one legacy test suite): * Unit tests - use standard `go test` and - [gotestyourself/assert](https://godoc.org/github.com/gotestyourself/gotestyourself/assert) assertions. They are located in + [gotest.tools/assert](https://godoc.org/gotest.tools/assert) assertions. They are located in the package they test. Unit tests should be fast and test only their own package. * API integration tests - use standard `go test` and - [gotestyourself/assert](https://godoc.org/github.com/gotestyourself/gotestyourself/assert) assertions. They are located in + [gotest.tools/assert](https://godoc.org/gotest.tools/assert) assertions. They are located in `./integration/` directories, where `component` is: container, image, volume, etc. These tests perform HTTP requests to an API endpoint and check the HTTP response and daemon state after the call. diff --git a/api/server/middleware/debug_test.go b/api/server/middleware/debug_test.go index cc227b324844fb9b08b4089ca3c84ab10dd4146b..a64b73e0d718b2b59efc8cf63bd77d0b181af834 100644 --- a/api/server/middleware/debug_test.go +++ b/api/server/middleware/debug_test.go @@ -3,8 +3,8 @@ package middleware // import "github.com/docker/docker/api/server/middleware" import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestMaskSecretKeys(t *testing.T) { diff --git a/api/server/middleware/version_test.go b/api/server/middleware/version_test.go index c439c8abfc1eae285559292da4f392cf00ce8446..edbc0bcaa589fb02078f6c85eaa63cccda87d4f9 100644 --- a/api/server/middleware/version_test.go +++ b/api/server/middleware/version_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/docker/docker/api/server/httputils" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestVersionMiddlewareVersion(t *testing.T) { diff --git a/api/types/filters/parse_test.go b/api/types/filters/parse_test.go index fbd9ae4fb174ac559e33fae99aca34e7a12b3ab1..e8345a1d5d524f074c08c938a44405534d859f13 100644 --- a/api/types/filters/parse_test.go +++ b/api/types/filters/parse_test.go @@ -4,8 +4,8 @@ import ( "errors" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestParseArgs(t *testing.T) { diff --git a/builder/dockerfile/buildargs_test.go b/builder/dockerfile/buildargs_test.go index c3f61048626f09cf1f0e6e9f908186fa13beaa7e..c3b82c83f4b606ab70967de47b8dc44cb52ac8e8 100644 --- a/builder/dockerfile/buildargs_test.go +++ b/builder/dockerfile/buildargs_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func strPtr(source string) *string { diff --git a/builder/dockerfile/copy_test.go b/builder/dockerfile/copy_test.go index f2f895387ce787c23ed5af69894342ea6aebfba4..f559ff4fd8213a3387d35f9d3c1aac43283f3c90 100644 --- a/builder/dockerfile/copy_test.go +++ b/builder/dockerfile/copy_test.go @@ -5,9 +5,9 @@ import ( "testing" "github.com/docker/docker/pkg/containerfs" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) func TestIsExistingDirectory(t *testing.T) { diff --git a/builder/dockerfile/dispatchers_test.go b/builder/dockerfile/dispatchers_test.go index a5474d6db8e77cd746a93858cffc13be233c71be..36d20a1a82bdfc31d5018396d90783c7d929b564 100644 --- a/builder/dockerfile/dispatchers_test.go +++ b/builder/dockerfile/dispatchers_test.go @@ -14,10 +14,10 @@ import ( "github.com/docker/docker/image" "github.com/docker/docker/pkg/system" "github.com/docker/go-connections/nat" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/moby/buildkit/frontend/dockerfile/instructions" "github.com/moby/buildkit/frontend/dockerfile/shell" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func newBuilderWithMockBackend() *Builder { diff --git a/builder/dockerfile/evaluator_test.go b/builder/dockerfile/evaluator_test.go index 4657b1c58073fbb9804ae225722b35234f05f98a..fb79b238e8219cebd2dc89e57137a1d0877a6210 100644 --- a/builder/dockerfile/evaluator_test.go +++ b/builder/dockerfile/evaluator_test.go @@ -7,10 +7,10 @@ import ( "github.com/docker/docker/builder/remotecontext" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/reexec" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" "github.com/moby/buildkit/frontend/dockerfile/instructions" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) type dispatchTestCase struct { @@ -97,7 +97,7 @@ func initDispatchTestCases() []dispatchTestCase { } func TestDispatch(t *testing.T) { - skip.IfCondition(t, os.Getuid() != 0, "skipping test that requires root") + skip.If(t, os.Getuid() != 0, "skipping test that requires root") testCases := initDispatchTestCases() for _, testCase := range testCases { diff --git a/builder/dockerfile/internals_linux_test.go b/builder/dockerfile/internals_linux_test.go index c244ddfe3febebdc27101390b4b74b73bbb44b7e..1b3a99893a72b869c8f4d2ef77906c2833563e73 100644 --- a/builder/dockerfile/internals_linux_test.go +++ b/builder/dockerfile/internals_linux_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/docker/docker/pkg/idtools" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestChownFlagParsing(t *testing.T) { diff --git a/builder/dockerfile/internals_test.go b/builder/dockerfile/internals_test.go index afd4a45f88b43378b64a2bd7df1082781f5c78fd..1c34fd3871c9651dc19fdf7f40e82b52ebfcc32a 100644 --- a/builder/dockerfile/internals_test.go +++ b/builder/dockerfile/internals_test.go @@ -13,9 +13,9 @@ import ( "github.com/docker/docker/builder/remotecontext" "github.com/docker/docker/pkg/archive" "github.com/docker/go-connections/nat" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestEmptyDockerfile(t *testing.T) { @@ -61,7 +61,7 @@ func TestNonExistingDockerfile(t *testing.T) { } func readAndCheckDockerfile(t *testing.T, testName, contextDir, dockerfilePath, expectedError string) { - skip.IfCondition(t, os.Getuid() != 0, "skipping test that requires root") + skip.If(t, os.Getuid() != 0, "skipping test that requires root") tarStream, err := archive.Tar(contextDir, archive.Uncompressed) assert.NilError(t, err) diff --git a/builder/dockerfile/internals_windows_test.go b/builder/dockerfile/internals_windows_test.go index ffe52fb132623d1da532b0bae9b2962a1aad30d2..4f00623404dbba47550a1eb984fe65c71907e3fb 100644 --- a/builder/dockerfile/internals_windows_test.go +++ b/builder/dockerfile/internals_windows_test.go @@ -6,8 +6,8 @@ import ( "fmt" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestNormalizeDest(t *testing.T) { diff --git a/builder/fscache/fscache_test.go b/builder/fscache/fscache_test.go index 16712ff7438943a36f11cb3ce9e5228922d0333c..5108d65df15761659a9841289e58f2c7dbd27ddc 100644 --- a/builder/fscache/fscache_test.go +++ b/builder/fscache/fscache_test.go @@ -8,9 +8,9 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/moby/buildkit/session/filesync" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestFSCache(t *testing.T) { diff --git a/builder/remotecontext/git/gitutils_test.go b/builder/remotecontext/git/gitutils_test.go index a46675b22b6c24926f5a9cf9cfd8ff2e3252208b..8c39679081f1e9acb9bccefbde5e33bde5388f56 100644 --- a/builder/remotecontext/git/gitutils_test.go +++ b/builder/remotecontext/git/gitutils_test.go @@ -14,8 +14,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestParseRemoteURL(t *testing.T) { diff --git a/builder/remotecontext/mimetype_test.go b/builder/remotecontext/mimetype_test.go index b13429cfa8a675627472f55cd9aa9653f82f7087..df9c37877091f089dbccf43538a6e20ea38ec60a 100644 --- a/builder/remotecontext/mimetype_test.go +++ b/builder/remotecontext/mimetype_test.go @@ -3,8 +3,8 @@ package remotecontext // import "github.com/docker/docker/builder/remotecontext" import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDetectContentType(t *testing.T) { diff --git a/builder/remotecontext/remote_test.go b/builder/remotecontext/remote_test.go index 64442d5107623c80462e1550b0fda50c3f5ca9cf..a0101f7493853936a23b790b555aaacb5c8ab4ed 100644 --- a/builder/remotecontext/remote_test.go +++ b/builder/remotecontext/remote_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/docker/docker/builder" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) var binaryContext = []byte{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00} //xz magic diff --git a/builder/remotecontext/tarsum_test.go b/builder/remotecontext/tarsum_test.go index b05e4449ff15ac90552b1496318182285c8a6b9a..46f128d9f06085d19f2f9fa6cc0ea6af90c132cc 100644 --- a/builder/remotecontext/tarsum_test.go +++ b/builder/remotecontext/tarsum_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/builder" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/reexec" - "github.com/gotestyourself/gotestyourself/skip" "github.com/pkg/errors" + "gotest.tools/skip" ) const ( @@ -137,7 +137,7 @@ func TestRemoveDirectory(t *testing.T) { } func makeTestArchiveContext(t *testing.T, dir string) builder.Source { - skip.IfCondition(t, os.Getuid() != 0, "skipping test that requires root") + skip.If(t, os.Getuid() != 0, "skipping test that requires root") tarStream, err := archive.Tar(dir, archive.Uncompressed) if err != nil { t.Fatalf("error: %s", err) diff --git a/client/client_test.go b/client/client_test.go index 403aa9f3f0784702b0cc28af427b321ea8fccbbb..58bccaa31150872cae9977296aabfb87f4486d0c 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -10,10 +10,10 @@ import ( "github.com/docker/docker/api" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/env" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/env" + "gotest.tools/skip" ) func TestNewEnvClient(t *testing.T) { diff --git a/client/config_create_test.go b/client/config_create_test.go index 8675e7f541a146e082d1bd8df466bc59fc333bab..a6408792db9318444260df20ad2482a4eb5ac35b 100644 --- a/client/config_create_test.go +++ b/client/config_create_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestConfigCreateUnsupported(t *testing.T) { diff --git a/client/config_inspect_test.go b/client/config_inspect_test.go index b0c30fa27942fb463fa2f23bfefc60680543c4b5..76a5dae9e5ebc431bf75a9029b1b01918273d06f 100644 --- a/client/config_inspect_test.go +++ b/client/config_inspect_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestConfigInspectNotFound(t *testing.T) { diff --git a/client/config_list_test.go b/client/config_list_test.go index e01d3d4c9df5caf80987549239b9e689026f3004..b35a5929531efbb04a665cde5388e9ca2439339b 100644 --- a/client/config_list_test.go +++ b/client/config_list_test.go @@ -13,8 +13,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestConfigListUnsupported(t *testing.T) { diff --git a/client/config_remove_test.go b/client/config_remove_test.go index d574c5be0cfe2baad79b753a649a0ed80736ee9b..9c0c0f9337e2c8540b4b87e56c1e3d5583637e30 100644 --- a/client/config_remove_test.go +++ b/client/config_remove_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestConfigRemoveUnsupported(t *testing.T) { diff --git a/client/config_update_test.go b/client/config_update_test.go index 8b82d42eda9fa885f1d9cb00a79fc8e818004bec..1299f8278ca7c85d27c487c4e8c009fc7dcfba66 100644 --- a/client/config_update_test.go +++ b/client/config_update_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestConfigUpdateUnsupported(t *testing.T) { diff --git a/client/container_logs_test.go b/client/container_logs_test.go index f4ba0e76b475f8577dce46fb2dbcc8ae5cf6a916..6d6e34e1012728117db67431d23eca8b66f2cc15 100644 --- a/client/container_logs_test.go +++ b/client/container_logs_test.go @@ -14,8 +14,8 @@ import ( "time" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestContainerLogsNotFoundError(t *testing.T) { diff --git a/client/container_prune_test.go b/client/container_prune_test.go index 9efb7b58547710b7dd01b12f0d63f30bac2621d4..6a830d01dcacb734c124df692106b539eebe7f34 100644 --- a/client/container_prune_test.go +++ b/client/container_prune_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestContainersPruneError(t *testing.T) { diff --git a/client/container_remove_test.go b/client/container_remove_test.go index 8a2d01b1882cd577c436b014f60b4a49e29fc5eb..d94d8313041e86cc5b00ce91fbf4d8f54c84ddfc 100644 --- a/client/container_remove_test.go +++ b/client/container_remove_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestContainerRemoveError(t *testing.T) { diff --git a/client/distribution_inspect_test.go b/client/distribution_inspect_test.go index d3c6828df13ae61c0496ae58af72cebd9781d5e6..a23d5f55d59fb60117e8f439e28529daa6ef43f1 100644 --- a/client/distribution_inspect_test.go +++ b/client/distribution_inspect_test.go @@ -5,9 +5,9 @@ import ( "net/http" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDistributionInspectUnsupported(t *testing.T) { diff --git a/client/hijack_test.go b/client/hijack_test.go index dea5addb8ccf065dc84dd1b99e513bf3cddf7e5b..823bf344f53fec24b9db69c022e4a374b1f919a7 100644 --- a/client/hijack_test.go +++ b/client/hijack_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/server/httputils" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" "github.com/pkg/errors" "golang.org/x/net/context" + "gotest.tools/assert" ) func TestTLSCloseWriter(t *testing.T) { diff --git a/client/image_prune_test.go b/client/image_prune_test.go index 3de3226f83b176c0d0b923efe89cd68434af8297..9b0839bb6c12bee9c808f86c96a26dc244beba2d 100644 --- a/client/image_prune_test.go +++ b/client/image_prune_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestImagesPruneError(t *testing.T) { diff --git a/client/image_remove_test.go b/client/image_remove_test.go index 274d450ac49b235d84f6db36076088f162109c57..acc6bc91776028c00e8c9adf5b70e6627e974274 100644 --- a/client/image_remove_test.go +++ b/client/image_remove_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestImageRemoveError(t *testing.T) { diff --git a/client/network_inspect_test.go b/client/network_inspect_test.go index 4f4919e3054e314373cd9fbc90402b6e17d7509b..699bccba675a00e91156cc32513a6c1684fedc7f 100644 --- a/client/network_inspect_test.go +++ b/client/network_inspect_test.go @@ -12,9 +12,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/network" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestNetworkInspectError(t *testing.T) { diff --git a/client/network_prune_test.go b/client/network_prune_test.go index f67b6ab4d37b920d8e5b7bcc0a63c841a71bdbde..7a5d340e519539a262dcb928388ccb504f64675c 100644 --- a/client/network_prune_test.go +++ b/client/network_prune_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestNetworksPruneError(t *testing.T) { diff --git a/client/ping_test.go b/client/ping_test.go index a26a136e3e54a36f704fe72fb31d4c15969843f9..10bbbe811de620e988056d3e5a56dbce05d84dac 100644 --- a/client/ping_test.go +++ b/client/ping_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // TestPingFail tests that when a server sends a non-successful response that we diff --git a/client/request_test.go b/client/request_test.go index e45a8651a09a1beaa19a1bc4bdc29ebebd02a24e..fda4d88aa142559f46114ac1b1bb60453e68ac3e 100644 --- a/client/request_test.go +++ b/client/request_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // TestSetHostHeader should set fake host for local communications, set real host diff --git a/client/secret_create_test.go b/client/secret_create_test.go index 83f99cd09ccc58419d1faeb297f26ce1c5eac957..419bdbcbc6213f89b3c24b05ecb6183beb091eb1 100644 --- a/client/secret_create_test.go +++ b/client/secret_create_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSecretCreateUnsupported(t *testing.T) { diff --git a/client/secret_inspect_test.go b/client/secret_inspect_test.go index 75782324a29b006822560d7616b27c45eff17641..6c84799b1767a195cf4c68febeea55d0df0bee2f 100644 --- a/client/secret_inspect_test.go +++ b/client/secret_inspect_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSecretInspectUnsupported(t *testing.T) { diff --git a/client/secret_list_test.go b/client/secret_list_test.go index 4fc3235f3d9ecae8c4cd10c4ea149d1c2549a447..72323b055faa02fb6f2ec6c2a82e413c460d3dc9 100644 --- a/client/secret_list_test.go +++ b/client/secret_list_test.go @@ -13,8 +13,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSecretListUnsupported(t *testing.T) { diff --git a/client/secret_remove_test.go b/client/secret_remove_test.go index 03e0316cab28ec59c8be50969fe247ecc4132601..bdfccf6be86d68dc6810c2f339b4e35da3cf5790 100644 --- a/client/secret_remove_test.go +++ b/client/secret_remove_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSecretRemoveUnsupported(t *testing.T) { diff --git a/client/secret_update_test.go b/client/secret_update_test.go index d0ce89cda2c82a06ae6585fd023e2b79a3b7c05b..c7670b440c37b53fc6534c5b57c88b7e804ca089 100644 --- a/client/secret_update_test.go +++ b/client/secret_update_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSecretUpdateUnsupported(t *testing.T) { diff --git a/client/service_create_test.go b/client/service_create_test.go index 1ef2f422cd734723d5f630a5bfcaaa7b587f9b31..9f51c18223b8a0cb95e90933347a8b2725652b5d 100644 --- a/client/service_create_test.go +++ b/client/service_create_test.go @@ -13,10 +13,10 @@ import ( "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" "github.com/docker/docker/api/types/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" "github.com/opencontainers/image-spec/specs-go/v1" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestServiceCreateError(t *testing.T) { diff --git a/client/service_logs_test.go b/client/service_logs_test.go index c3d624e21245008237c18929eaa3b3a7c5988459..28f3ab5c6b669e55fe77dcd7e26b1af9ce44fec8 100644 --- a/client/service_logs_test.go +++ b/client/service_logs_test.go @@ -14,8 +14,8 @@ import ( "time" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestServiceLogsError(t *testing.T) { diff --git a/client/service_remove_test.go b/client/service_remove_test.go index 45892ceb2f28b7f657138ec0d01c8796da0bd4db..d2379a13663920dd4f30b182878e5579e986e083 100644 --- a/client/service_remove_test.go +++ b/client/service_remove_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestServiceRemoveError(t *testing.T) { diff --git a/client/swarm_get_unlock_key_test.go b/client/swarm_get_unlock_key_test.go index be822cb8aa94a5af515c53b6657c8020669e0237..a1e460c1dc51d0c50bee715634e55ffe928454fc 100644 --- a/client/swarm_get_unlock_key_test.go +++ b/client/swarm_get_unlock_key_test.go @@ -11,8 +11,8 @@ import ( "testing" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSwarmGetUnlockKeyError(t *testing.T) { diff --git a/client/volume_inspect_test.go b/client/volume_inspect_test.go index d0a3246689ccea1f33bab4984498600f9cdc4537..04f00129b714214e034b16c8bb06910cb63f9d35 100644 --- a/client/volume_inspect_test.go +++ b/client/volume_inspect_test.go @@ -11,9 +11,9 @@ import ( "testing" "github.com/docker/docker/api/types" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestVolumeInspectError(t *testing.T) { diff --git a/cmd/dockerd/config_unix_test.go b/cmd/dockerd/config_unix_test.go index eaa53d8f6fec8eb696ea3a6247028581cb939714..d7dbf4b4cc5d74f7542dfcef402a33f89d143b8a 100644 --- a/cmd/dockerd/config_unix_test.go +++ b/cmd/dockerd/config_unix_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/docker/docker/daemon/config" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDaemonParseShmSize(t *testing.T) { diff --git a/cmd/dockerd/daemon_test.go b/cmd/dockerd/daemon_test.go index 539b442cbd7dcbe3812aec3d801a97816570602c..ad447e3b90b5d62fb2b242ca40960bb15fba49c1 100644 --- a/cmd/dockerd/daemon_test.go +++ b/cmd/dockerd/daemon_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/docker/docker/daemon/config" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" "github.com/sirupsen/logrus" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) func defaultOptions(configFile string) *daemonOptions { diff --git a/cmd/dockerd/daemon_unix_test.go b/cmd/dockerd/daemon_unix_test.go index 39ff1e682269a77afdde087b2d35c62681a5b51a..692d0328c4167007fcca0d64b070373424acb718 100644 --- a/cmd/dockerd/daemon_unix_test.go +++ b/cmd/dockerd/daemon_unix_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/docker/docker/daemon/config" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) func TestLoadDaemonCliConfigWithDaemonFlags(t *testing.T) { diff --git a/cmd/dockerd/options_test.go b/cmd/dockerd/options_test.go index 2a4e63b6b624f10a1be233c2e79c9c4471931441..691118f08fbe1dd92796b1df3ac88f9129f4ac5d 100644 --- a/cmd/dockerd/options_test.go +++ b/cmd/dockerd/options_test.go @@ -6,9 +6,9 @@ import ( cliconfig "github.com/docker/docker/cli/config" "github.com/docker/docker/daemon/config" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestCommonOptionsInstallFlags(t *testing.T) { diff --git a/container/container_unit_test.go b/container/container_unit_test.go index fbee6e5eb05677e13b9feb653c661d1ec5643695..82b5864760fca092271415be0d1aa892cc0e5edd 100644 --- a/container/container_unit_test.go +++ b/container/container_unit_test.go @@ -11,7 +11,7 @@ import ( swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/daemon/logger/jsonfilelog" "github.com/docker/docker/pkg/signal" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestContainerStopSignal(t *testing.T) { diff --git a/container/view_test.go b/container/view_test.go index a872dffea617eb4016f885347688ac477e376f9b..434b7c618d53bb06ac53f7006d257c8dbe3dda5b 100644 --- a/container/view_test.go +++ b/container/view_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pborman/uuid" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var root string diff --git a/daemon/cluster/convert/service_test.go b/daemon/cluster/convert/service_test.go index 826cf6fbefe00b4b3d924a3dd0730c1a0a2162a9..ad5f0d449424642b30ae6bd5b3f4ebbcf5885a77 100644 --- a/daemon/cluster/convert/service_test.go +++ b/daemon/cluster/convert/service_test.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/swarm/runtime" swarmapi "github.com/docker/swarmkit/api" google_protobuf3 "github.com/gogo/protobuf/types" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestServiceConvertFromGRPCRuntimeContainer(t *testing.T) { diff --git a/daemon/cluster/executor/container/container_test.go b/daemon/cluster/executor/container/container_test.go index f9e8c8a92e5b61daa487f4fd3bee8b756fe7391a..1bf6f6cf02648dde0a41f51208d0f80d83d60d69 100644 --- a/daemon/cluster/executor/container/container_test.go +++ b/daemon/cluster/executor/container/container_test.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types/container" swarmapi "github.com/docker/swarmkit/api" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestIsolationConversion(t *testing.T) { diff --git a/daemon/config/config_test.go b/daemon/config/config_test.go index cb7aa740710e1e44bb341f59031de35b0c804a54..6998ed331234222345eae546fa4a60d86bf3465e 100644 --- a/daemon/config/config_test.go +++ b/daemon/config/config_test.go @@ -8,11 +8,11 @@ import ( "github.com/docker/docker/daemon/discovery" "github.com/docker/docker/opts" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" - "github.com/gotestyourself/gotestyourself/skip" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" + "gotest.tools/skip" ) func TestDaemonConfigurationNotFound(t *testing.T) { @@ -461,7 +461,7 @@ func TestReloadSetConfigFileNotExist(t *testing.T) { // TestReloadDefaultConfigNotExist tests that if the default configuration file // doesn't exist the daemon still will be reloaded. func TestReloadDefaultConfigNotExist(t *testing.T) { - skip.IfCondition(t, os.Getuid() != 0, "skipping test that requires root") + skip.If(t, os.Getuid() != 0, "skipping test that requires root") reloaded := false configFile := "/etc/docker/daemon.json" flags := pflag.NewFlagSet("test", pflag.ContinueOnError) diff --git a/daemon/config/config_unix_test.go b/daemon/config/config_unix_test.go index d9bb9476ac73ad022ac62f6d6f1677a04cf7a5db..529b6777050e7951138ba74dac08336950107622 100644 --- a/daemon/config/config_unix_test.go +++ b/daemon/config/config_unix_test.go @@ -7,10 +7,10 @@ import ( "github.com/docker/docker/opts" "github.com/docker/go-units" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) func TestGetConflictFreeConfiguration(t *testing.T) { diff --git a/daemon/config/config_windows_test.go b/daemon/config/config_windows_test.go index fff98014f9823f46fe21d4303a5a214bf3ecd4a7..09417ee388307ed2bf4ca6a0be794947e6ccdbec 100644 --- a/daemon/config/config_windows_test.go +++ b/daemon/config/config_windows_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/docker/docker/opts" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/spf13/pflag" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDaemonConfigurationMerge(t *testing.T) { diff --git a/daemon/container_unix_test.go b/daemon/container_unix_test.go index 12075f8b8df05336502ec2e8369e97a9150b9b8a..b4c5f84c7e794632f8e0d92928fdaf0d21cdaa85 100644 --- a/daemon/container_unix_test.go +++ b/daemon/container_unix_test.go @@ -9,7 +9,7 @@ import ( containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/daemon/config" "github.com/docker/go-connections/nat" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // TestContainerWarningHostAndPublishPorts that a warning is returned when setting network mode to host and specifying published ports. diff --git a/daemon/create_test.go b/daemon/create_test.go index 7ef49d76233605e0cd8e19bdfb3317d503bbb21e..3dba847d46b3d3098f0cdab6a67d3ebbb34ddd16 100644 --- a/daemon/create_test.go +++ b/daemon/create_test.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types/network" "github.com/docker/docker/errdefs" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // Test case for 35752 diff --git a/daemon/daemon_linux_test.go b/daemon/daemon_linux_test.go index 1635b08535fad35b917141f6ec94600f189cf8d3..767925e2fb2b0da45dda905e449cbbe5719c8367 100644 --- a/daemon/daemon_linux_test.go +++ b/daemon/daemon_linux_test.go @@ -15,8 +15,8 @@ import ( "github.com/docker/docker/oci" "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/mount" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) const mountsFixture = `142 78 0:38 / / rw,relatime - aufs none rw,si=573b861da0b3a05b,dio diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 4e068194f0692dbbe63526feff29a88a333e718f..43f4f504b6f9874d6c90cd1116bfe8ecf5ca8a48 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -16,9 +16,9 @@ import ( volumesservice "github.com/docker/docker/volume/service" "github.com/docker/go-connections/nat" "github.com/docker/libnetwork" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // diff --git a/daemon/delete_test.go b/daemon/delete_test.go index 4af206d9c65916f566c23f7cfe64ce829e86ae54..d600917b0c188747f07eedf969f2fe526ec977ce 100644 --- a/daemon/delete_test.go +++ b/daemon/delete_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func newDaemonWithTmpRoot(t *testing.T) (*Daemon, func()) { diff --git a/daemon/discovery/discovery_test.go b/daemon/discovery/discovery_test.go index d00e02e10b2cdf8cd1338b23b9df3b137a7874d8..c354a2918d646afeaf9b221f2c70c0260632f594 100644 --- a/daemon/discovery/discovery_test.go +++ b/daemon/discovery/discovery_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDiscoveryOptsErrors(t *testing.T) { diff --git a/daemon/exec_linux_test.go b/daemon/exec_linux_test.go index 9e5496ae4b6e3c8a98f7325dc300b2b1aa4995f0..0db7f080db106770ed2bca8531f0b287461538ad 100644 --- a/daemon/exec_linux_test.go +++ b/daemon/exec_linux_test.go @@ -8,9 +8,9 @@ import ( containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/container" "github.com/docker/docker/daemon/exec" - "github.com/gotestyourself/gotestyourself/assert" "github.com/opencontainers/runc/libcontainer/apparmor" "github.com/opencontainers/runtime-spec/specs-go" + "gotest.tools/assert" ) func TestExecSetPlatformOpt(t *testing.T) { diff --git a/daemon/graphdriver/aufs/aufs_test.go b/daemon/graphdriver/aufs/aufs_test.go index 2338ad320d72edbd6b895ed91b776642e96752b0..fdc502ba65341e9bff12d8e5d2912ce4a2ac9b52 100644 --- a/daemon/graphdriver/aufs/aufs_test.go +++ b/daemon/graphdriver/aufs/aufs_test.go @@ -17,8 +17,8 @@ import ( "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/stringid" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var ( diff --git a/daemon/graphdriver/copy/copy_test.go b/daemon/graphdriver/copy/copy_test.go index b41348827d69401e73f3c7b4e63f0186d7efd6c9..0f3b1670f741a4289af4404bc44620ad46cc6413 100644 --- a/daemon/graphdriver/copy/copy_test.go +++ b/daemon/graphdriver/copy/copy_test.go @@ -13,9 +13,9 @@ import ( "time" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestCopy(t *testing.T) { diff --git a/daemon/graphdriver/driver_test.go b/daemon/graphdriver/driver_test.go index 4a29465f152856f6be74f2c014eedd441123d06d..e6f973c397e87fcb8fb16641a461359fca9836e8 100644 --- a/daemon/graphdriver/driver_test.go +++ b/daemon/graphdriver/driver_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestIsEmptyDir(t *testing.T) { diff --git a/daemon/graphdriver/graphtest/graphbench_unix.go b/daemon/graphdriver/graphtest/graphbench_unix.go index 1b221dabeffa511f02b06d61fc14ea7c47ab03c5..22de8d17813ad3a1d8b97672d6095d59ea78082b 100644 --- a/daemon/graphdriver/graphtest/graphbench_unix.go +++ b/daemon/graphdriver/graphtest/graphbench_unix.go @@ -9,7 +9,7 @@ import ( contdriver "github.com/containerd/continuity/driver" "github.com/docker/docker/pkg/stringid" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // DriverBenchExists benchmarks calls to exist diff --git a/daemon/graphdriver/graphtest/graphtest_unix.go b/daemon/graphdriver/graphtest/graphtest_unix.go index 5ac3979752a1a15693d1e514be89e4e726a221c9..e83d0bb2ad77e5bd964eb762c9cf9ffa4f0e810d 100644 --- a/daemon/graphdriver/graphtest/graphtest_unix.go +++ b/daemon/graphdriver/graphtest/graphtest_unix.go @@ -16,9 +16,9 @@ import ( "github.com/docker/docker/daemon/graphdriver/quota" "github.com/docker/docker/pkg/stringid" "github.com/docker/go-units" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var ( diff --git a/daemon/graphdriver/graphtest/testutil_unix.go b/daemon/graphdriver/graphtest/testutil_unix.go index 3103df150d2045b7dd14471fa52f1c371e405e1d..6871dca09a690e185edc4bc2d2962dadf8711eeb 100644 --- a/daemon/graphdriver/graphtest/testutil_unix.go +++ b/daemon/graphdriver/graphtest/testutil_unix.go @@ -9,9 +9,9 @@ import ( contdriver "github.com/containerd/continuity/driver" "github.com/docker/docker/daemon/graphdriver" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func verifyFile(t testing.TB, path string, mode os.FileMode, uid, gid uint32) { diff --git a/daemon/graphdriver/quota/projectquota_test.go b/daemon/graphdriver/quota/projectquota_test.go index 2f1bf593debcfd781ac3cbfcd0d215d6b9484061..aa164cc4198a15dcfc329dc5146e4f0054a31b75 100644 --- a/daemon/graphdriver/quota/projectquota_test.go +++ b/daemon/graphdriver/quota/projectquota_test.go @@ -10,10 +10,10 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) // 10MB diff --git a/daemon/info_unix_test.go b/daemon/info_unix_test.go index 7ff1009326513f81046f1177b0a6690ab9b9ea7c..a5a4e06f98451ebc1f59e5d75e8868a918c04fa6 100644 --- a/daemon/info_unix_test.go +++ b/daemon/info_unix_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/dockerversion" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestParseInitVersion(t *testing.T) { diff --git a/daemon/inspect_test.go b/daemon/inspect_test.go index d1ad5b0e0a45c6b929e3c450b857931b7a88d157..f402a7af99b6e107fa2f9ed61714ecffc4538fc5 100644 --- a/daemon/inspect_test.go +++ b/daemon/inspect_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/docker/container" "github.com/docker/docker/daemon/config" "github.com/docker/docker/daemon/exec" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestGetInspectData(t *testing.T) { diff --git a/daemon/list_test.go b/daemon/list_test.go index d35eac3cd69705eb784c649134ad3b95688152d5..3be510d13d94097789d67cedb17bce6ba7eb2cfd 100644 --- a/daemon/list_test.go +++ b/daemon/list_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/container" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestListInvalidFilter(t *testing.T) { diff --git a/daemon/logger/adapter_test.go b/daemon/logger/adapter_test.go index e9143928b4a11e87c25fcdf9a494081c40f8648c..f47e711c892eae21dd3f74effc39713a380dec1f 100644 --- a/daemon/logger/adapter_test.go +++ b/daemon/logger/adapter_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types/plugins/logdriver" protoio "github.com/gogo/protobuf/io" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // mockLoggingPlugin implements the loggingPlugin interface for testing purposes diff --git a/daemon/logger/awslogs/cloudwatchlogs_test.go b/daemon/logger/awslogs/cloudwatchlogs_test.go index b8e49055e833230567ae66ed21d87eaf229fadcc..6955d910c3d5b23d157497018af3573e74357227 100644 --- a/daemon/logger/awslogs/cloudwatchlogs_test.go +++ b/daemon/logger/awslogs/cloudwatchlogs_test.go @@ -21,8 +21,8 @@ import ( "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/loggerutils" "github.com/docker/docker/dockerversion" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) const ( diff --git a/daemon/logger/jsonfilelog/jsonfilelog_test.go b/daemon/logger/jsonfilelog/jsonfilelog_test.go index 2becd694b0d2f9b25b5a4e92901f52568741cfcb..22bbcf2eb7a1609abb7d944d44d25a7798b8443a 100644 --- a/daemon/logger/jsonfilelog/jsonfilelog_test.go +++ b/daemon/logger/jsonfilelog/jsonfilelog_test.go @@ -14,9 +14,9 @@ import ( "github.com/docker/docker/daemon/logger" "github.com/docker/docker/daemon/logger/jsonfilelog/jsonlog" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) func TestJSONFileLogger(t *testing.T) { diff --git a/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes_test.go b/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes_test.go index b3bfe6b18c85385252d6d4004948da00661ee3ab..d268db4df0c975888c98495d6f86f7e3f8bf973c 100644 --- a/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes_test.go +++ b/daemon/logger/jsonfilelog/jsonlog/jsonlogbytes_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestJSONLogsMarshalJSONBuf(t *testing.T) { diff --git a/daemon/logger/jsonfilelog/jsonlog/time_marshalling_test.go b/daemon/logger/jsonfilelog/jsonlog/time_marshalling_test.go index 3cfdcc33db9bd799d373292ae198c64315ed256e..b3959b0467a50dd7defc7b04fe444ad1de86684b 100644 --- a/daemon/logger/jsonfilelog/jsonlog/time_marshalling_test.go +++ b/daemon/logger/jsonfilelog/jsonlog/time_marshalling_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestFastTimeMarshalJSONWithInvalidYear(t *testing.T) { diff --git a/daemon/logger/jsonfilelog/read_test.go b/daemon/logger/jsonfilelog/read_test.go index f89fabfe1c6826fd9f6a7dfce66b6f82a94fb72c..cad8003e5efd371946342f5e5ede6bf75ebd0915 100644 --- a/daemon/logger/jsonfilelog/read_test.go +++ b/daemon/logger/jsonfilelog/read_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/docker/docker/daemon/logger" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + "gotest.tools/fs" ) func BenchmarkJSONFileLoggerReadLogs(b *testing.B) { diff --git a/daemon/logger/splunk/splunk_test.go b/daemon/logger/splunk/splunk_test.go index 62895a6dd68cf56a36212d2fdfdf312f1b06b369..cfb83e80d1c55e2eee4c4f39bc9f5f37979d5ff0 100644 --- a/daemon/logger/splunk/splunk_test.go +++ b/daemon/logger/splunk/splunk_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/docker/docker/daemon/logger" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/env" + "gotest.tools/assert" + "gotest.tools/env" ) // Validate options diff --git a/daemon/logger/templates/templates_test.go b/daemon/logger/templates/templates_test.go index b767037477a09eabd9f20833c0e116bedbb72553..25e7c887507817ec504fdbd6f83802a88670133e 100644 --- a/daemon/logger/templates/templates_test.go +++ b/daemon/logger/templates/templates_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestNewParse(t *testing.T) { diff --git a/daemon/oci_linux_test.go b/daemon/oci_linux_test.go index e28fac004efdfecf2dcd203ace8ba5c264f822d3..e618951ef95ea7e27e7094762987f3490577086c 100644 --- a/daemon/oci_linux_test.go +++ b/daemon/oci_linux_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/daemon/config" "github.com/docker/docker/oci" "github.com/docker/docker/pkg/idtools" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // TestTmpfsDevShmNoDupMount checks that a user-specified /dev/shm tmpfs diff --git a/daemon/reload_test.go b/daemon/reload_test.go index c4d15d93e556946d6a3cb3fd81e8b759eb2d1846..ffad297f71b74161f63c0a7e843902d78f1b4580 100644 --- a/daemon/reload_test.go +++ b/daemon/reload_test.go @@ -13,8 +13,8 @@ import ( _ "github.com/docker/docker/pkg/discovery/memory" "github.com/docker/docker/registry" "github.com/docker/libnetwork" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDaemonReloadLabels(t *testing.T) { diff --git a/daemon/resize_test.go b/daemon/resize_test.go index dea26c61164260d2054d7507b3f8b3acdd4b2846..edfe9d3ed17715d1eaa0f68da1af664042c30660 100644 --- a/daemon/resize_test.go +++ b/daemon/resize_test.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/container" "github.com/docker/docker/daemon/exec" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // This test simply verify that when a wrong ID used, a specific error should be returned for exec resize. diff --git a/daemon/trustkey_test.go b/daemon/trustkey_test.go index e13129e46743fbf8d8414ece901e02492d88dee3..e49e76aa3eeec94a0b20e31719eac5acdd455506 100644 --- a/daemon/trustkey_test.go +++ b/daemon/trustkey_test.go @@ -6,9 +6,9 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" ) // LoadOrCreateTrustKey diff --git a/distribution/metadata/v1_id_service_test.go b/distribution/metadata/v1_id_service_test.go index 7bac8e821230c170f4ef05f250ea7948bc455032..5003897cbb92d5fe584137e16c76cff239bcaa0b 100644 --- a/distribution/metadata/v1_id_service_test.go +++ b/distribution/metadata/v1_id_service_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/docker/docker/layer" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestV1IDService(t *testing.T) { diff --git a/distribution/pull_v2_test.go b/distribution/pull_v2_test.go index 1079b5fe53843a9e0f12a48249d3537dd0257810..ca3470c8cfe8d3b862352231c9342d6c79eb443a 100644 --- a/distribution/pull_v2_test.go +++ b/distribution/pull_v2_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/distribution/manifest/schema1" "github.com/docker/distribution/reference" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // TestFixManifestLayers checks that fixManifestLayers removes a duplicate diff --git a/image/fs_test.go b/image/fs_test.go index e8c120a0032cd0f39b54fb481545667415e6fd86..6290c2b66e841f97686696ac7bd10a540e34a3a4 100644 --- a/image/fs_test.go +++ b/image/fs_test.go @@ -10,9 +10,9 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func defaultFSStoreBackend(t *testing.T) (StoreBackend, func()) { diff --git a/image/image_test.go b/image/image_test.go index dfb438b4d316f109ad3750d83a5c45b31633578a..981be0b68c698c41578d14bac9a4f6a01f203ee9 100644 --- a/image/image_test.go +++ b/image/image_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/layer" "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) const sampleImageJSON = `{ diff --git a/image/store_test.go b/image/store_test.go index d59cde9195f8d338365e83ae7bdd4b4433f3d225..0edf3282af4719b64ab74393741a02d5e683b73f 100644 --- a/image/store_test.go +++ b/image/store_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/docker/docker/layer" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" + "gotest.tools/assert" + "gotest.tools/assert/cmp" ) func TestRestore(t *testing.T) { diff --git a/integration-cli/cli/build/build.go b/integration-cli/cli/build/build.go index 71048d0d6ddac296c8682ad0ccf7c3de6d3c522d..0b10ea79f81e5729dbe3a02dcdf2b3396184f786 100644 --- a/integration-cli/cli/build/build.go +++ b/integration-cli/cli/build/build.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/docker/docker/internal/test/fakecontext" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) type testingT interface { diff --git a/integration-cli/cli/cli.go b/integration-cli/cli/cli.go index 17f3fd52caf06f9a3a1f846c223fa4512ff6f8e4..bc3f3c194e52e67fa572e9fa20ddac274fddac01 100644 --- a/integration-cli/cli/cli.go +++ b/integration-cli/cli/cli.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/integration-cli/environment" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/pkg/errors" + "gotest.tools/assert" + "gotest.tools/icmd" ) var testEnv *environment.Execution diff --git a/integration-cli/daemon/daemon.go b/integration-cli/daemon/daemon.go index fcbbfdfb0ce39e8626f3f3c1b2d95cb469b1e750..3d1fa38d5dde31585e9dc7b18a98107f9eeabf02 100644 --- a/integration-cli/daemon/daemon.go +++ b/integration-cli/daemon/daemon.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/internal/test/daemon" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/pkg/errors" + "gotest.tools/assert" + "gotest.tools/icmd" ) type testingT interface { diff --git a/integration-cli/daemon/daemon_swarm.go b/integration-cli/daemon/daemon_swarm.go index c38f5a69e067b19246b1d12ad4b042751655d74f..4a6ce8a5c5142c82472c5201cd768dc32f4e6940 100644 --- a/integration-cli/daemon/daemon_swarm.go +++ b/integration-cli/daemon/daemon_swarm.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // CheckServiceTasksInState returns the number of tasks with a matching state, diff --git a/integration-cli/docker_api_build_test.go b/integration-cli/docker_api_build_test.go index 581df8d5c709e937cc1b487104ad37605bb49004..144acbd046e4e86913afe877912f25e58b9f6335 100644 --- a/integration-cli/docker_api_build_test.go +++ b/integration-cli/docker_api_build_test.go @@ -19,8 +19,8 @@ import ( "github.com/docker/docker/internal/test/fakestorage" "github.com/docker/docker/internal/test/request" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func (s *DockerSuite) TestBuildAPIDockerFileRemote(c *check.C) { diff --git a/integration-cli/docker_api_build_windows_test.go b/integration-cli/docker_api_build_windows_test.go index 92d3f5e13459fc5fb23c66c9f53efeb5aab25810..a605c5be3922553a4cb0ac1b25917dd2b421a10b 100644 --- a/integration-cli/docker_api_build_windows_test.go +++ b/integration-cli/docker_api_build_windows_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/docker/internal/test/request" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func (s *DockerSuite) TestBuildWithRecycleBin(c *check.C) { diff --git a/integration-cli/docker_api_containers_test.go b/integration-cli/docker_api_containers_test.go index 31d6077880d135b99e6867d1d86c3fd0cf70806d..e8e47bd8b15731f6b4a5c5fe0367529856f630d2 100644 --- a/integration-cli/docker_api_containers_test.go +++ b/integration-cli/docker_api_containers_test.go @@ -33,9 +33,9 @@ import ( "github.com/docker/docker/volume" "github.com/docker/go-connections/nat" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" ) func (s *DockerSuite) TestContainerAPIGetAll(c *check.C) { diff --git a/integration-cli/docker_api_containers_windows_test.go b/integration-cli/docker_api_containers_windows_test.go index 8b71fc607746b0a5ab77a606a7a3365421e271d3..c569574de535089022408b4e14e68e76c7e1328a 100644 --- a/integration-cli/docker_api_containers_windows_test.go +++ b/integration-cli/docker_api_containers_windows_test.go @@ -14,8 +14,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/mount" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func (s *DockerSuite) TestContainersAPICreateMountsBindNamedPipe(c *check.C) { diff --git a/integration-cli/docker_api_inspect_test.go b/integration-cli/docker_api_inspect_test.go index 5d7aa5590380e48a1ab4133301fd4a7fdfa4655e..68055b6c145fa4ffc4c615c81beea5c3874bcfad 100644 --- a/integration-cli/docker_api_inspect_test.go +++ b/integration-cli/docker_api_inspect_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func (s *DockerSuite) TestInspectAPIContainerResponse(c *check.C) { diff --git a/integration-cli/docker_api_swarm_service_test.go b/integration-cli/docker_api_swarm_service_test.go index 2e27c7e93dfa41579b4c999ff1211098d6e54279..1a826c99c6bd3e1a76d6f630e466b1609117972c 100644 --- a/integration-cli/docker_api_swarm_service_test.go +++ b/integration-cli/docker_api_swarm_service_test.go @@ -17,8 +17,8 @@ import ( "github.com/docker/docker/integration-cli/daemon" testdaemon "github.com/docker/docker/internal/test/daemon" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "golang.org/x/sys/unix" + "gotest.tools/icmd" ) func setPortConfig(portConfig []swarm.PortConfig) testdaemon.ServiceConstructor { diff --git a/integration-cli/docker_api_swarm_test.go b/integration-cli/docker_api_swarm_test.go index 11cdd89215e0ca5d10646b5998083c66a7c77cb7..6a31dd209f01f78998369b15036fe333e5ba5a31 100644 --- a/integration-cli/docker_api_swarm_test.go +++ b/integration-cli/docker_api_swarm_test.go @@ -26,8 +26,8 @@ import ( "github.com/docker/docker/internal/test/request" "github.com/docker/swarmkit/ca" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var defaultReconciliationTimeout = 30 * time.Second diff --git a/integration-cli/docker_cli_attach_test.go b/integration-cli/docker_cli_attach_test.go index 353cb65e5d17757717fa5299388105ff39764fe4..ef2c708bbe63a23c55d6ef911359094deba3851c 100644 --- a/integration-cli/docker_cli_attach_test.go +++ b/integration-cli/docker_cli_attach_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) const attachWait = 5 * time.Second diff --git a/integration-cli/docker_cli_build_test.go b/integration-cli/docker_cli_build_test.go index a0ac9c767f8a6885a213e84e6d099202e84f950a..1e88b1ba39fd4a2b55d95f3cdfde10dbc1836876 100644 --- a/integration-cli/docker_cli_build_test.go +++ b/integration-cli/docker_cli_build_test.go @@ -16,7 +16,6 @@ import ( "text/template" "time" - "github.com/moby/buildkit/frontend/dockerfile/command" "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" @@ -26,8 +25,9 @@ import ( "github.com/docker/docker/internal/testutil" "github.com/docker/docker/pkg/archive" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "github.com/moby/buildkit/frontend/dockerfile/command" "github.com/opencontainers/go-digest" + "gotest.tools/icmd" ) func (s *DockerSuite) TestBuildJSONEmptyRun(c *check.C) { diff --git a/integration-cli/docker_cli_build_unix_test.go b/integration-cli/docker_cli_build_unix_test.go index 4b313f95c19e9ed72157dad17e8f7fba4e2b6a14..8cad28f4573713ba2f0398b3ea68502ac7988cbe 100644 --- a/integration-cli/docker_cli_build_unix_test.go +++ b/integration-cli/docker_cli_build_unix_test.go @@ -21,7 +21,7 @@ import ( "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/go-units" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestBuildResourceConstraintsAreUsed(c *check.C) { diff --git a/integration-cli/docker_cli_by_digest_test.go b/integration-cli/docker_cli_by_digest_test.go index ac97e0aecc5f3f52da9d10bf8b9322991c63a18c..006cf11e1a634f7361b172aeab765b263dbb9902 100644 --- a/integration-cli/docker_cli_by_digest_test.go +++ b/integration-cli/docker_cli_by_digest_test.go @@ -15,9 +15,9 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var ( diff --git a/integration-cli/docker_cli_cp_test.go b/integration-cli/docker_cli_cp_test.go index b33be6b2099f974e0e885d612de976502a3f9646..ec53712fab116c42af8766e79a22b28388f1043c 100644 --- a/integration-cli/docker_cli_cp_test.go +++ b/integration-cli/docker_cli_cp_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) const ( diff --git a/integration-cli/docker_cli_daemon_plugins_test.go b/integration-cli/docker_cli_daemon_plugins_test.go index 2f66bc05e20efc0cb8a2d609ade675409193f65a..69e190c30dd5cfe59ec55dd4bd10995cac1de311 100644 --- a/integration-cli/docker_cli_daemon_plugins_test.go +++ b/integration-cli/docker_cli_daemon_plugins_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/pkg/mount" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "golang.org/x/sys/unix" + "gotest.tools/icmd" ) // TestDaemonRestartWithPluginEnabled tests state restore for an enabled plugin diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index 347696e8a4428c002770f6b42e3fb9f65a2db7db..d2ff9606e53cee2fb648df3c5d99e69d7b038b34 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -39,9 +39,9 @@ import ( "github.com/docker/libnetwork/iptables" "github.com/docker/libtrust" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/kr/pty" "golang.org/x/sys/unix" + "gotest.tools/icmd" ) // TestLegacyDaemonCommand test starting docker daemon using "deprecated" docker daemon diff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go index 28e418ea3b4774e2fbcc2c602e0635db6122ee47..db1e34020f58e33972a7deca4fbab173a9362bd0 100644 --- a/integration-cli/docker_cli_events_test.go +++ b/integration-cli/docker_cli_events_test.go @@ -20,7 +20,7 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) { diff --git a/integration-cli/docker_cli_exec_test.go b/integration-cli/docker_cli_exec_test.go index d0557c56a0a4bb30b867ee1b4196228aa9304ff7..e97fb851402dfc1af56b0c03d90b2e4bac6c534e 100644 --- a/integration-cli/docker_cli_exec_test.go +++ b/integration-cli/docker_cli_exec_test.go @@ -20,7 +20,7 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestExec(c *check.C) { diff --git a/integration-cli/docker_cli_export_import_test.go b/integration-cli/docker_cli_export_import_test.go index 6405c1bb5e50896657984b578814130dec9ff978..d0dac973676654ff42d2051a4a3e40c21b2dc2f5 100644 --- a/integration-cli/docker_cli_export_import_test.go +++ b/integration-cli/docker_cli_export_import_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // TODO: Move this test to docker/cli, as it is essentially the same test diff --git a/integration-cli/docker_cli_images_test.go b/integration-cli/docker_cli_images_test.go index 2a1152eb5044faa4de760498dac07f31ebbecb2d..0dd319fbc9ac561e6e889cd3351d3dbf2d6bb65e 100644 --- a/integration-cli/docker_cli_images_test.go +++ b/integration-cli/docker_cli_images_test.go @@ -14,7 +14,7 @@ import ( "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/pkg/stringid" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestImagesEnsureImageIsListed(c *check.C) { diff --git a/integration-cli/docker_cli_import_test.go b/integration-cli/docker_cli_import_test.go index eb0fe2cf8cb7b5f73654b2f9bc65484e3e453544..9f8e9158036c9b0ae5a34c7ac72b35a43cf9cb75 100644 --- a/integration-cli/docker_cli_import_test.go +++ b/integration-cli/docker_cli_import_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestImportDisplay(c *check.C) { diff --git a/integration-cli/docker_cli_inspect_test.go b/integration-cli/docker_cli_inspect_test.go index a1130aebf5a7ed13dfa2fc2b9fff766458f4fece..d027c447750d1a3a597cdc10a24e046630c7f97c 100644 --- a/integration-cli/docker_cli_inspect_test.go +++ b/integration-cli/docker_cli_inspect_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func checkValidGraphDriver(c *check.C, name string) { diff --git a/integration-cli/docker_cli_logs_test.go b/integration-cli/docker_cli_logs_test.go index fb99b2807d53c44a11c0debe2758c8821ce2ab50..17ee5deaad81ce42fcb0c39ac760f6b713bc268b 100644 --- a/integration-cli/docker_cli_logs_test.go +++ b/integration-cli/docker_cli_logs_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/pkg/jsonmessage" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // This used to work, it test a log of PageSize-1 (gh#4851) diff --git a/integration-cli/docker_cli_network_unix_test.go b/integration-cli/docker_cli_network_unix_test.go index 1087d0045dad036a01a3be37486b53f060aad3e2..95f7ccfff07b87ec697e9e24157e8f813acd61bf 100644 --- a/integration-cli/docker_cli_network_unix_test.go +++ b/integration-cli/docker_cli_network_unix_test.go @@ -27,9 +27,9 @@ import ( remoteipam "github.com/docker/libnetwork/ipams/remote/api" "github.com/docker/libnetwork/netlabel" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/vishvananda/netlink" "golang.org/x/sys/unix" + "gotest.tools/icmd" ) const dummyNetworkDriver = "dummy-network-driver" diff --git a/integration-cli/docker_cli_proxy_test.go b/integration-cli/docker_cli_proxy_test.go index bdb47725929252f009356000e32f097a16294515..52159aa9c538ed811f7d94d1885292e376de0f19 100644 --- a/integration-cli/docker_cli_proxy_test.go +++ b/integration-cli/docker_cli_proxy_test.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestCLIProxyDisableProxyUnixSock(c *check.C) { diff --git a/integration-cli/docker_cli_prune_unix_test.go b/integration-cli/docker_cli_prune_unix_test.go index 259b48676644e9b6bf6790a22a89aa16411eedd2..d60420b59148109244a752ef9c02eaa12ece22ec 100644 --- a/integration-cli/docker_cli_prune_unix_test.go +++ b/integration-cli/docker_cli_prune_unix_test.go @@ -15,7 +15,7 @@ import ( "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/integration-cli/daemon" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func pruneNetworkAndVerify(c *check.C, d *daemon.Daemon, kept, pruned []string) { diff --git a/integration-cli/docker_cli_ps_test.go b/integration-cli/docker_cli_ps_test.go index 771c9d70d5d8095b7a816b8096b2f8d442e6a15a..a975bc35424afac0732195532a3171e19bd71ec4 100644 --- a/integration-cli/docker_cli_ps_test.go +++ b/integration-cli/docker_cli_ps_test.go @@ -13,7 +13,7 @@ import ( "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/pkg/stringid" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestPsListContainersBase(c *check.C) { diff --git a/integration-cli/docker_cli_pull_local_test.go b/integration-cli/docker_cli_pull_local_test.go index 31afdfb539602b0b6c8d25616c978ca6e6d7bb86..33d4ae5e7c612164d892e51cfd28f530f2710c17 100644 --- a/integration-cli/docker_cli_pull_local_test.go +++ b/integration-cli/docker_cli_pull_local_test.go @@ -16,8 +16,8 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/opencontainers/go-digest" + "gotest.tools/icmd" ) // testPullImageWithAliases pulls a specific image tag and verifies that any aliases (i.e., other diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go index 382260a5c75b6c76cbcb3ed850380af4f23221b7..01ad829192b1962fde61abd6a8605162acbbc2b4 100644 --- a/integration-cli/docker_cli_push_test.go +++ b/integration-cli/docker_cli_push_test.go @@ -14,7 +14,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // Pushing an image to a private registry. diff --git a/integration-cli/docker_cli_rmi_test.go b/integration-cli/docker_cli_rmi_test.go index aedfa13a814e9c4e74737d28febfd92b3d0fc0cb..662285682327d9dd0d5c32bac7c64cf66ae1c5ee 100644 --- a/integration-cli/docker_cli_rmi_test.go +++ b/integration-cli/docker_cli_rmi_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/integration-cli/cli/build" "github.com/docker/docker/pkg/stringid" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestRmiWithContainerFails(c *check.C) { diff --git a/integration-cli/docker_cli_run_test.go b/integration-cli/docker_cli_run_test.go index 7e0efdc08f64a538e6f2625f45e204af8ee77aa9..aaaa7174d3bfb4ef65f8919501dcdca3cb08417b 100644 --- a/integration-cli/docker_cli_run_test.go +++ b/integration-cli/docker_cli_run_test.go @@ -36,7 +36,7 @@ import ( "github.com/docker/libnetwork/resolvconf" "github.com/docker/libnetwork/types" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // "test123" should be printed by docker run diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index 70acbb37f3db7b2e5385566ad633cfeafec24b4a..3444d22bfd953d13953b0c9a51a11ff34bc3b00f 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -26,8 +26,8 @@ import ( "github.com/docker/docker/pkg/parsers" "github.com/docker/docker/pkg/sysinfo" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/kr/pty" + "gotest.tools/icmd" ) // #6509 diff --git a/integration-cli/docker_cli_save_load_test.go b/integration-cli/docker_cli_save_load_test.go index d370b6cc5ef0bf191c94368efb23f517efaae702..688eac684ea83cc269aa7fcd3092e7a3be48dfd8 100644 --- a/integration-cli/docker_cli_save_load_test.go +++ b/integration-cli/docker_cli_save_load_test.go @@ -18,8 +18,8 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/opencontainers/go-digest" + "gotest.tools/icmd" ) // save a repo using gz compression and try to load it using stdout diff --git a/integration-cli/docker_cli_save_load_unix_test.go b/integration-cli/docker_cli_save_load_unix_test.go index fcbfd7e62752f274e541e97491b1fb8a0f49809b..da520e41c0cb6a96eddd96b9aa723d97c3bde698 100644 --- a/integration-cli/docker_cli_save_load_unix_test.go +++ b/integration-cli/docker_cli_save_load_unix_test.go @@ -14,8 +14,8 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/kr/pty" + "gotest.tools/icmd" ) // save a repo and try to load it using stdout diff --git a/integration-cli/docker_cli_service_health_test.go b/integration-cli/docker_cli_service_health_test.go index ac525d08ea84906f0c30aa7b3733ffa55065f3e7..ae9e7868bb2cd771fb2e1c64659c2f28eafc2d4c 100644 --- a/integration-cli/docker_cli_service_health_test.go +++ b/integration-cli/docker_cli_service_health_test.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/integration-cli/cli" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // start a service, and then make its task unhealthy during running diff --git a/integration-cli/docker_cli_service_logs_test.go b/integration-cli/docker_cli_service_logs_test.go index c26a7455a51a219dc0abd9518df29c4856f7be15..ba337491b144079254c0b4480f6fbef638161036 100644 --- a/integration-cli/docker_cli_service_logs_test.go +++ b/integration-cli/docker_cli_service_logs_test.go @@ -13,7 +13,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/daemon" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) type logMessage struct { diff --git a/integration-cli/docker_cli_start_test.go b/integration-cli/docker_cli_start_test.go index 98f7beaea90e38a0471a3bd417a06a2c967739c4..cbe917bf4f8056661da13f28329fd10295cea7e7 100644 --- a/integration-cli/docker_cli_start_test.go +++ b/integration-cli/docker_cli_start_test.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // Regression test for https://github.com/docker/docker/issues/7843 diff --git a/integration-cli/docker_cli_swarm_test.go b/integration-cli/docker_cli_swarm_test.go index 94013d82b39f502bb12cd63815038421d81c2c26..057c0d94c88dcd8ecb38b49daad867b13d6f8fd1 100644 --- a/integration-cli/docker_cli_swarm_test.go +++ b/integration-cli/docker_cli_swarm_test.go @@ -27,9 +27,9 @@ import ( remoteipam "github.com/docker/libnetwork/ipams/remote/api" "github.com/docker/swarmkit/ca/keyutils" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/fs" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/vishvananda/netlink" + "gotest.tools/fs" + "gotest.tools/icmd" ) func (s *DockerSwarmSuite) TestSwarmUpdate(c *check.C) { diff --git a/integration-cli/docker_cli_top_test.go b/integration-cli/docker_cli_top_test.go index b8924d3b506230d504a91add196054f90fcfc0ad..50744b0111187c41edda6d93ea3b03de5735abf4 100644 --- a/integration-cli/docker_cli_top_test.go +++ b/integration-cli/docker_cli_top_test.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestTopMultipleArgs(c *check.C) { diff --git a/integration-cli/docker_cli_volume_test.go b/integration-cli/docker_cli_volume_test.go index ad1e96577c2b55b98c1e64a0ce0454687de24347..340bdfe2543702fcb81836dadb4b3042a9cd38c4 100644 --- a/integration-cli/docker_cli_volume_test.go +++ b/integration-cli/docker_cli_volume_test.go @@ -16,7 +16,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/docker/docker/integration-cli/cli/build" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) func (s *DockerSuite) TestVolumeCLICreate(c *check.C) { diff --git a/integration-cli/docker_cli_wait_test.go b/integration-cli/docker_cli_wait_test.go index e8047042d002e1526fa22f1b857d5e7a8df6a2cd..669e54f1ae095c7eb4f84e244124335a2d2f6bef 100644 --- a/integration-cli/docker_cli_wait_test.go +++ b/integration-cli/docker_cli_wait_test.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/integration-cli/checker" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // non-blocking wait with 0 exit code diff --git a/integration-cli/docker_utils_test.go b/integration-cli/docker_utils_test.go index 19fdcff19a1349598dc0af1b2b2144bf032d0505..1c05bf5d04ac4d7286f8bc2d58a238a437deed31 100644 --- a/integration-cli/docker_utils_test.go +++ b/integration-cli/docker_utils_test.go @@ -21,7 +21,7 @@ import ( "github.com/docker/docker/integration-cli/daemon" "github.com/docker/docker/internal/test/request" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // Deprecated diff --git a/integration-cli/requirements_test.go b/integration-cli/requirements_test.go index e6038edb186cd2246868d4c08d1899ed8f20b2eb..28be59cd2ca8b8d7f24dd0823fa2005fca3fd320 100644 --- a/integration-cli/requirements_test.go +++ b/integration-cli/requirements_test.go @@ -60,7 +60,7 @@ func OnlyDefaultNetworks() bool { return true } -// Deprecated: use skip.IfCondition(t, !testEnv.DaemonInfo.ExperimentalBuild) +// Deprecated: use skip.If(t, !testEnv.DaemonInfo.ExperimentalBuild) func ExperimentalDaemon() bool { return testEnv.DaemonInfo.ExperimentalBuild } diff --git a/integration-cli/utils_test.go b/integration-cli/utils_test.go index 33913c392209688a3f82a77a0fd06119468db566..fd083681f266bcf428387936bdaf8c28c555fe41 100644 --- a/integration-cli/utils_test.go +++ b/integration-cli/utils_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/internal/testutil" "github.com/go-check/check" - "github.com/gotestyourself/gotestyourself/icmd" "github.com/pkg/errors" + "gotest.tools/icmd" ) func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) { @@ -21,7 +21,7 @@ func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) { } // TODO: update code to call cmd.RunCmd directly, and remove this function -// Deprecated: use gotestyourself/gotestyourself/icmd +// Deprecated: use gotest.tools/icmd func runCommandWithOutput(execCmd *exec.Cmd) (string, int, error) { result := icmd.RunCmd(transformCmd(execCmd)) return result.Combined(), result.ExitCode, result.Error diff --git a/integration/build/build_session_test.go b/integration/build/build_session_test.go index c2f93629440f090eb3ebd52f6b222297258e14ef..dde4b427b4974e35ab407f7cba12ed6802edfd08 100644 --- a/integration/build/build_session_test.go +++ b/integration/build/build_session_test.go @@ -10,12 +10,12 @@ import ( dclient "github.com/docker/docker/client" "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" "github.com/moby/buildkit/session" "github.com/moby/buildkit/session/filesync" "golang.org/x/sync/errgroup" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestBuildWithSession(t *testing.T) { diff --git a/integration/build/build_squash_test.go b/integration/build/build_squash_test.go index 9110604e4fd69d47b32b4a17232c3c08edf192fc..4cd282a976030b1eee771f1eb0c2e6aec0b0efce 100644 --- a/integration/build/build_squash_test.go +++ b/integration/build/build_squash_test.go @@ -12,9 +12,9 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/docker/pkg/stdcopy" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestBuildSquashParent(t *testing.T) { diff --git a/integration/build/build_test.go b/integration/build/build_test.go index ee9631d3ff4a431754ca984cbc4e359a18e5b19e..25c5e635bdfdf7e642213abcaa976a2d82b1cdca 100644 --- a/integration/build/build_test.go +++ b/integration/build/build_test.go @@ -16,9 +16,9 @@ import ( "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/jsonmessage" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestBuildWithRemoveAndForceRemove(t *testing.T) { @@ -385,7 +385,7 @@ COPY bar /` // docker/for-linux#135 // #35641 func TestBuildMultiStageLayerLeak(t *testing.T) { - skip.IfCondition(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions") + skip.If(t, versions.LessThan(testEnv.DaemonAPIVersion(), "1.37"), "broken in earlier versions") ctx := context.TODO() defer setupTest(t)() diff --git a/integration/config/config_test.go b/integration/config/config_test.go index 1c002423eabd0ab1fbda250255b8ec67282ee1be..3cbca23899d117c2e4b811a42576f4b51a59f913 100644 --- a/integration/config/config_test.go +++ b/integration/config/config_test.go @@ -14,9 +14,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/pkg/stdcopy" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestConfigList(t *testing.T) { diff --git a/integration/container/copy_test.go b/integration/container/copy_test.go index 6794f9855523d43bddc921205ba56b51354958cc..241b719eb70e32169f9e1c6a48cb7d8cc494c3ea 100644 --- a/integration/container/copy_test.go +++ b/integration/container/copy_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestCopyFromContainerPathDoesNotExist(t *testing.T) { diff --git a/integration/container/create_test.go b/integration/container/create_test.go index 9c466448903a0a0400c46399f8b97774d6965d9a..f94eb4a3fb8e9687e3cdda6c9dc86a1cdc1464c6 100644 --- a/integration/container/create_test.go +++ b/integration/container/create_test.go @@ -14,10 +14,10 @@ import ( ctr "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/oci" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestCreateFailsWhenIdentifierDoesNotExist(t *testing.T) { diff --git a/integration/container/daemon_linux_test.go b/integration/container/daemon_linux_test.go index df6aa683abac67cd5ad17f2bc3af5912d727347f..bc5c5076b8e6586587270cd4cc4fcce7fee3f4bd 100644 --- a/integration/container/daemon_linux_test.go +++ b/integration/container/daemon_linux_test.go @@ -11,9 +11,9 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" "golang.org/x/sys/unix" + "gotest.tools/assert" + "gotest.tools/skip" ) // This is a regression test for #36145 diff --git a/integration/container/diff_test.go b/integration/container/diff_test.go index fee58391e9903dbd64fc0bbfbe56dc879ba058e8..b4219c3627e94e1baca358c68b3fe0fafe3f15dc 100644 --- a/integration/container/diff_test.go +++ b/integration/container/diff_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/archive" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/assert" + "gotest.tools/poll" ) func TestDiff(t *testing.T) { diff --git a/integration/container/exec_test.go b/integration/container/exec_test.go index e1750d9414382f8ca9f72062f495f7873405fc4b..85f9e0591571e55b3a13f6e706991e8041d4de7c 100644 --- a/integration/container/exec_test.go +++ b/integration/container/exec_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestExec(t *testing.T) { diff --git a/integration/container/export_test.go b/integration/container/export_test.go index dbeea341cdd2ca74e7c257bcb0f0e1d4e433cc51..7a9ed0aa99fbd4027b727046183fd91531da37f0 100644 --- a/integration/container/export_test.go +++ b/integration/container/export_test.go @@ -12,10 +12,10 @@ import ( "github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/jsonmessage" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) // export an image and try to import it into a new one diff --git a/integration/container/health_test.go b/integration/container/health_test.go index e13885002d31fee390a76cc4ae99b4b16732d872..7cc196e46d740ca49ed1412e3e87a7e59ba1a9cd 100644 --- a/integration/container/health_test.go +++ b/integration/container/health_test.go @@ -10,7 +10,7 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/poll" ) // TestHealthCheckWorkdir verifies that health-checks inherit the containers' diff --git a/integration/container/inspect_test.go b/integration/container/inspect_test.go index 8ed590443355d7425126a3ee3a8267dbc698f41a..d034c536500e6f56aac0ce6e2767748d870fe206 100644 --- a/integration/container/inspect_test.go +++ b/integration/container/inspect_test.go @@ -9,10 +9,10 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestInspectCpusetInConfigPre120(t *testing.T) { diff --git a/integration/container/kill_test.go b/integration/container/kill_test.go index 8cef5bb897acd65184f2afe15dc18c5f350547dc..12a9083cf3a6371a9f93972db2e17cfd0e4683a1 100644 --- a/integration/container/kill_test.go +++ b/integration/container/kill_test.go @@ -9,10 +9,10 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestKillContainerInvalidSignal(t *testing.T) { diff --git a/integration/container/links_linux_test.go b/integration/container/links_linux_test.go index 9baa32728dd9ce565d1b99134fac5ad4f347cd81..f9f3cbe5eddf84c9acf9e32217e1f8150ff081f0 100644 --- a/integration/container/links_linux_test.go +++ b/integration/container/links_linux_test.go @@ -10,9 +10,9 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestLinksEtcHostsContentMatch(t *testing.T) { diff --git a/integration/container/logs_test.go b/integration/container/logs_test.go index 80e3d9a6c6a29af134f94a4a93c5d19decf84e92..68fbe13a73709e2b7292a4ccd6172565a10a3379 100644 --- a/integration/container/logs_test.go +++ b/integration/container/logs_test.go @@ -9,15 +9,15 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/stdcopy" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) // Regression test for #35370 // Makes sure that when following we don't get an EOF error when there are no logs func TestLogsFollowTailEmpty(t *testing.T) { // FIXME(vdemeester) fails on a e2e run on linux... - skip.IfCondition(t, testEnv.IsRemoteDaemon()) + skip.If(t, testEnv.IsRemoteDaemon()) defer setupTest(t)() client := request.NewAPIClient(t) ctx := context.Background() diff --git a/integration/container/mounts_linux_test.go b/integration/container/mounts_linux_test.go index 884eebb1b4f35ad4bf2cfb68745cec2a3eb81a94..a0a8836c5171ba7841b25957f335ab96f4d97958 100644 --- a/integration/container/mounts_linux_test.go +++ b/integration/container/mounts_linux_test.go @@ -13,10 +13,10 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" + "gotest.tools/skip" ) func TestContainerNetworkMountsNoChown(t *testing.T) { diff --git a/integration/container/nat_test.go b/integration/container/nat_test.go index 12541b6a0a8eda9b3d0d0d0c4abb1c701a818784..0dbed897dbd770370a71ded3c8edfdb49370b1bf 100644 --- a/integration/container/nat_test.go +++ b/integration/container/nat_test.go @@ -15,10 +15,10 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/docker/go-connections/nat" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestNetworkNat(t *testing.T) { diff --git a/integration/container/pause_test.go b/integration/container/pause_test.go index 8f856bcb3c6f43558db8c97b8a79029a9ad0d457..8dd2d784b70c2331fc200e0228d016ed2aa1a392 100644 --- a/integration/container/pause_test.go +++ b/integration/container/pause_test.go @@ -12,10 +12,10 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestPause(t *testing.T) { diff --git a/integration/container/ps_test.go b/integration/container/ps_test.go index 1080cd2f572cc5e9e24673f816759d24bfcddeee..4ae07043ab9a012150d27285e67bac09488d653d 100644 --- a/integration/container/ps_test.go +++ b/integration/container/ps_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestPsFilter(t *testing.T) { diff --git a/integration/container/remove_test.go b/integration/container/remove_test.go index 185f90cc00d95880f396a785e9116e925353e130..5de13f22adcef5ea51997ee3c487c2cd4fbcc406 100644 --- a/integration/container/remove_test.go +++ b/integration/container/remove_test.go @@ -10,11 +10,11 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/fs" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/fs" + "gotest.tools/poll" + "gotest.tools/skip" ) func getPrefixAndSlashFromDaemonPlatform() (prefix, slash string) { diff --git a/integration/container/rename_test.go b/integration/container/rename_test.go index fd270052a5d8e008735da137db14b2a6a1f9ff6e..c3f46e10c2d01cce8cf5e7230ae91b46db66bf4f 100644 --- a/integration/container/rename_test.go +++ b/integration/container/rename_test.go @@ -12,10 +12,10 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/stringid" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) // This test simulates the scenario mentioned in #31392: diff --git a/integration/container/resize_test.go b/integration/container/resize_test.go index c6c4e81751917c3166c8a2c0865c8bff497581d7..5961af0a4729c1a849a41a21a6a9b412d8147f44 100644 --- a/integration/container/resize_test.go +++ b/integration/container/resize_test.go @@ -11,10 +11,10 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" req "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestResize(t *testing.T) { diff --git a/integration/container/restart_test.go b/integration/container/restart_test.go index c63faba3a7433965bfced384df451cb6b1573ba1..69007218f1a4c107cb05c8c25b4f73f064107eed 100644 --- a/integration/container/restart_test.go +++ b/integration/container/restart_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) func TestDaemonRestartKillContainers(t *testing.T) { diff --git a/integration/container/stats_test.go b/integration/container/stats_test.go index dbececa0e5c844c83121983b7a338588f5095585..6493a30573e21f66768bb2c58a2706c15d2bdca2 100644 --- a/integration/container/stats_test.go +++ b/integration/container/stats_test.go @@ -10,10 +10,10 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestStats(t *testing.T) { diff --git a/integration/container/stop_test.go b/integration/container/stop_test.go index 2932ae0bf924b8f96ad99758812d07de3a8812e5..7a2fa20188a6c2eaff45f0c36dad22b6ec4798bb 100644 --- a/integration/container/stop_test.go +++ b/integration/container/stop_test.go @@ -11,10 +11,10 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/icmd" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/icmd" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestStopContainerWithRestartPolicyAlways(t *testing.T) { diff --git a/integration/container/update_linux_test.go b/integration/container/update_linux_test.go index 6e4fb637ff95e7135c677fa6ad43d5c5e8dd3c4a..0e410a14616abadb2f37c0803829c5660730d590 100644 --- a/integration/container/update_linux_test.go +++ b/integration/container/update_linux_test.go @@ -10,10 +10,10 @@ import ( containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestUpdateMemory(t *testing.T) { diff --git a/integration/container/update_test.go b/integration/container/update_test.go index 2ac122aea7188aabe6e530f52b2c0791ef3decaa..0e32184d27f10b8a8c5b56995c2e3dfae803d501 100644 --- a/integration/container/update_test.go +++ b/integration/container/update_test.go @@ -8,9 +8,9 @@ import ( containertypes "github.com/docker/docker/api/types/container" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" ) func TestUpdateRestartPolicy(t *testing.T) { diff --git a/integration/image/commit_test.go b/integration/image/commit_test.go index eb0b4e6b5d6845b67f8fefa931c98bf2503d3743..4555391262ec4d4378bdbd66b5c586d814ea508b 100644 --- a/integration/image/commit_test.go +++ b/integration/image/commit_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestCommitInheritsEnv(t *testing.T) { diff --git a/integration/image/remove_test.go b/integration/image/remove_test.go index 172c27f54dfa92f43e7d2df03ce28cb92454b1eb..4f9122a5e37b4bbe117927ea10b18577cd8812fb 100644 --- a/integration/image/remove_test.go +++ b/integration/image/remove_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestRemoveImageOrphaning(t *testing.T) { diff --git a/integration/image/tag_test.go b/integration/image/tag_test.go index 06431cd8a29b637367da67e901b1243c53842ba0..55c3ff7b2b0b24774d2285b5bf347e877606c030 100644 --- a/integration/image/tag_test.go +++ b/integration/image/tag_test.go @@ -7,8 +7,8 @@ import ( "github.com/docker/docker/internal/test/request" "github.com/docker/docker/internal/testutil" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // tagging a named image in a new unprefixed repo should work diff --git a/integration/internal/container/container.go b/integration/internal/container/container.go index 0c76571769bbd25dad748961661d60dd2ce6fe34..489e07154a1de08569a3ba923f698e71aff8424b 100644 --- a/integration/internal/container/container.go +++ b/integration/internal/container/container.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" "github.com/docker/docker/client" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // TestContainerConfig holds container configuration struct that diff --git a/integration/internal/container/states.go b/integration/internal/container/states.go index 1ee73e01a6b7224ec616b3cddc60749ace1f63aa..088407deb84eb71ca81523c61cf03032f9cf7d2a 100644 --- a/integration/internal/container/states.go +++ b/integration/internal/container/states.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/docker/docker/client" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/poll" ) // IsStopped verifies the container is in stopped state. diff --git a/integration/internal/network/network.go b/integration/internal/network/network.go index b9550362f00832515f6160acb3ab21c710a39984..9c13114f92e2e8b31ce99bd3c4f9883f2e45e30b 100644 --- a/integration/internal/network/network.go +++ b/integration/internal/network/network.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func createNetwork(ctx context.Context, client client.APIClient, name string, ops ...func(*types.NetworkCreate)) (string, error) { diff --git a/integration/internal/requirement/requirement.go b/integration/internal/requirement/requirement.go index cd498ab87d71e721f50996d838cc05e444bf4516..004383bd055d57b45173d0f212e2c92a0b19d8fc 100644 --- a/integration/internal/requirement/requirement.go +++ b/integration/internal/requirement/requirement.go @@ -7,7 +7,7 @@ import ( "time" "github.com/docker/docker/pkg/parsers/kernel" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/icmd" ) // HasHubConnectivity checks to see if https://hub.docker.com is diff --git a/integration/internal/swarm/service.go b/integration/internal/swarm/service.go index 5567ad6ede9e13df8fc1e8dd8be999d9e25373d2..d8b16224fb61e548cb7325880ccb53d45c084108 100644 --- a/integration/internal/swarm/service.go +++ b/integration/internal/swarm/service.go @@ -11,9 +11,9 @@ import ( swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/internal/test/environment" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/poll" + "gotest.tools/skip" ) // ServicePoll tweaks the pollSettings for `service` diff --git a/integration/network/delete_test.go b/integration/network/delete_test.go index 83d00bbdf14f65ed42254f6d0f247cacf7d91f09..c2684ae2479ae70f752527d85632630e12604030 100644 --- a/integration/network/delete_test.go +++ b/integration/network/delete_test.go @@ -8,9 +8,9 @@ import ( "github.com/docker/docker/api/types/versions" "github.com/docker/docker/integration/internal/network" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func containsNetwork(nws []types.NetworkResource, networkID string) bool { diff --git a/integration/network/helpers.go b/integration/network/helpers.go index df609dd4104f75b793bc1a40eb40c68347aa2ae7..c0d70a168e785a999adc110724cdbd2eee92d104 100644 --- a/integration/network/helpers.go +++ b/integration/network/helpers.go @@ -8,8 +8,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/docker/docker/pkg/parsers/kernel" - "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/icmd" + "gotest.tools/assert/cmp" + "gotest.tools/icmd" ) // CreateMasterDummy creates a dummy network interface diff --git a/integration/network/inspect_test.go b/integration/network/inspect_test.go index 052642f9808e666dd7d17e66300aefa6e44c3977..659ca2973582c86ca726f2e17bd6985a6b75022b 100644 --- a/integration/network/inspect_test.go +++ b/integration/network/inspect_test.go @@ -10,8 +10,8 @@ import ( swarmtypes "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/assert" + "gotest.tools/poll" ) const defaultSwarmPort = 2477 diff --git a/integration/network/ipvlan/ipvlan_test.go b/integration/network/ipvlan/ipvlan_test.go index 001565eefd46d6943d49eb26140bbe69df20963d..190c695a6b0b2705975e85157d57c95a0caa8f70 100644 --- a/integration/network/ipvlan/ipvlan_test.go +++ b/integration/network/ipvlan/ipvlan_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/integration/internal/container" n "github.com/docker/docker/integration/network" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) func TestDockerNetworkIpvlanPersistance(t *testing.T) { diff --git a/integration/network/macvlan/macvlan_test.go b/integration/network/macvlan/macvlan_test.go index 7d9acd813eb6ba6586c5763bc0b90947a541c19d..14dfce92cb6dadfe0e1ce528533219906a36b3b0 100644 --- a/integration/network/macvlan/macvlan_test.go +++ b/integration/network/macvlan/macvlan_test.go @@ -12,8 +12,8 @@ import ( net "github.com/docker/docker/integration/internal/network" n "github.com/docker/docker/integration/network" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) func TestDockerNetworkMacvlanPersistance(t *testing.T) { diff --git a/integration/network/service_test.go b/integration/network/service_test.go index 77ef870911acb51fd800fb51b7667563ef7c4c59..a15b0384c73a73c8237453d3892f18da60028ced 100644 --- a/integration/network/service_test.go +++ b/integration/network/service_test.go @@ -11,10 +11,10 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/icmd" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/icmd" + "gotest.tools/poll" + "gotest.tools/skip" ) // delInterface removes given network interface diff --git a/integration/plugin/authz/authz_plugin_test.go b/integration/plugin/authz/authz_plugin_test.go index 5585d93024c770f9d997adeb3667b5723af0945f..105affc1af077dd45eb8e895089d08e9c4eda3c9 100644 --- a/integration/plugin/authz/authz_plugin_test.go +++ b/integration/plugin/authz/authz_plugin_test.go @@ -25,8 +25,8 @@ import ( "github.com/docker/docker/internal/test/environment" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/authorization" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) const ( @@ -211,7 +211,7 @@ func TestAuthZPluginDenyResponse(t *testing.T) { // TestAuthZPluginAllowEventStream verifies event stream propagates // correctly after request pass through by the authorization plugin func TestAuthZPluginAllowEventStream(t *testing.T) { - skip.IfCondition(t, testEnv.DaemonInfo.OSType != "linux") + skip.If(t, testEnv.DaemonInfo.OSType != "linux") defer setupTestV1(t)() ctrl.reqRes.Allow = true diff --git a/integration/plugin/authz/authz_plugin_v2_test.go b/integration/plugin/authz/authz_plugin_v2_test.go index 93e36d76b9179b8d6526cae28e41cb213f651c37..5ebaca41c626a6e4fec8619cf573542688522a39 100644 --- a/integration/plugin/authz/authz_plugin_v2_test.go +++ b/integration/plugin/authz/authz_plugin_v2_test.go @@ -16,8 +16,8 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/requirement" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) var ( @@ -29,8 +29,8 @@ var ( ) func setupTestV2(t *testing.T) func() { - skip.IfCondition(t, testEnv.DaemonInfo.OSType != "linux") - skip.IfCondition(t, !requirement.HasHubConnectivity(t)) + skip.If(t, testEnv.DaemonInfo.OSType != "linux") + skip.If(t, !requirement.HasHubConnectivity(t)) teardown := setupTest(t) @@ -40,7 +40,7 @@ func setupTestV2(t *testing.T) func() { } func TestAuthZPluginV2AllowNonVolumeRequest(t *testing.T) { - skip.IfCondition(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") + skip.If(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") defer setupTestV2(t)() client, err := d.NewClient() @@ -64,7 +64,7 @@ func TestAuthZPluginV2AllowNonVolumeRequest(t *testing.T) { } func TestAuthZPluginV2Disable(t *testing.T) { - skip.IfCondition(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") + skip.If(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") defer setupTestV2(t)() client, err := d.NewClient() @@ -91,7 +91,7 @@ func TestAuthZPluginV2Disable(t *testing.T) { } func TestAuthZPluginV2RejectVolumeRequests(t *testing.T) { - skip.IfCondition(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") + skip.If(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") defer setupTestV2(t)() client, err := d.NewClient() @@ -127,7 +127,7 @@ func TestAuthZPluginV2RejectVolumeRequests(t *testing.T) { } func TestAuthZPluginV2BadManifestFailsDaemonStart(t *testing.T) { - skip.IfCondition(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") + skip.If(t, os.Getenv("DOCKER_ENGINE_GOARCH") != "amd64") defer setupTestV2(t)() client, err := d.NewClient() diff --git a/integration/plugin/authz/main_test.go b/integration/plugin/authz/main_test.go index 54bf259e95ff1bf8cc9aab30cf77d1d1cc072fc9..75555dc96fc3faca5f0ae4b18186b2f509e6fc08 100644 --- a/integration/plugin/authz/main_test.go +++ b/integration/plugin/authz/main_test.go @@ -16,7 +16,7 @@ import ( "github.com/docker/docker/internal/test/environment" "github.com/docker/docker/pkg/authorization" "github.com/docker/docker/pkg/plugins" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/skip" ) var ( diff --git a/integration/plugin/graphdriver/external_test.go b/integration/plugin/graphdriver/external_test.go index 11e24aec70338417f19ca6f3db6ee41cd04dac6f..3596056a84f5fd97e7a3e3c9f9582e9d0e753914 100644 --- a/integration/plugin/graphdriver/external_test.go +++ b/integration/plugin/graphdriver/external_test.go @@ -22,9 +22,9 @@ import ( "github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/plugins" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) type graphEventsCounter struct { diff --git a/integration/plugin/logging/logging_test.go b/integration/plugin/logging/logging_test.go index 1b6f2962bb4df95f41fe53e03ec26ef45f30f1f3..3921fa6e6985c0a01d0d70ded4c4bc69a47d1553 100644 --- a/integration/plugin/logging/logging_test.go +++ b/integration/plugin/logging/logging_test.go @@ -11,8 +11,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) func TestContinueAfterPluginCrash(t *testing.T) { diff --git a/integration/plugin/logging/validation_test.go b/integration/plugin/logging/validation_test.go index b0398cc6ab90bda77f7d9798ec3e803390e28b13..0d9b15efbfe4ab164792a106797b147f12efa9d1 100644 --- a/integration/plugin/logging/validation_test.go +++ b/integration/plugin/logging/validation_test.go @@ -6,8 +6,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) // Regression test for #35553 diff --git a/integration/plugin/volumes/mounts_test.go b/integration/plugin/volumes/mounts_test.go index 97e822279759bde8250573ed5082bb4be4e43c91..4b422ee5c39f5d360eb8208f3cc912415a9a94e9 100644 --- a/integration/plugin/volumes/mounts_test.go +++ b/integration/plugin/volumes/mounts_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/internal/test/fixtures/plugin" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) // TestPluginWithDevMounts tests very specific regression caused by mounts ordering diff --git a/integration/secret/secret_test.go b/integration/secret/secret_test.go index 939dad60de2ad2ff1c9d3ac22591b00d6076ec63..ecc3108f657745107c999218af227d540f065a00 100644 --- a/integration/secret/secret_test.go +++ b/integration/secret/secret_test.go @@ -13,9 +13,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/pkg/stdcopy" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestSecretInspect(t *testing.T) { diff --git a/integration/service/create_test.go b/integration/service/create_test.go index a2225696a26ce1362bc28313fbb925df5991e592..cc5ef9956fbddf67d1c1cbba283e09001392a48f 100644 --- a/integration/service/create_test.go +++ b/integration/service/create_test.go @@ -13,9 +13,9 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" ) func TestServiceCreateInit(t *testing.T) { diff --git a/integration/service/inspect_test.go b/integration/service/inspect_test.go index 7492a4fc021d6102ff30c023da53d3aa21da7522..daeabcfe1294c0bfd9406e5a15ed330baa179028 100644 --- a/integration/service/inspect_test.go +++ b/integration/service/inspect_test.go @@ -12,10 +12,10 @@ import ( "github.com/docker/docker/client" "github.com/docker/docker/integration/internal/swarm" "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestInspect(t *testing.T) { @@ -54,7 +54,7 @@ func TestInspect(t *testing.T) { assert.Check(t, is.DeepEqual(service, expected, cmpServiceOpts())) } -// TODO: use helpers from gotestyourself/assert/opt when available +// TODO: use helpers from gotest.tools/assert/opt when available func cmpServiceOpts() cmp.Option { const threshold = 20 * time.Second diff --git a/integration/service/network_test.go b/integration/service/network_test.go index d69aeb91f6cff602a00cae10ce959516e4b78fb2..4ebbd972a8e37feb4f49bdcb0e53c62399a22df1 100644 --- a/integration/service/network_test.go +++ b/integration/service/network_test.go @@ -8,8 +8,8 @@ import ( "github.com/docker/docker/api/types/network" "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/integration/internal/swarm" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestDockerNetworkConnectAlias(t *testing.T) { diff --git a/integration/service/plugin_test.go b/integration/service/plugin_test.go index 29a0398323166052bbd55977ef2ee106b0739bf9..6c61825220d25a2d3a95428146cd0a0037d1f5da 100644 --- a/integration/service/plugin_test.go +++ b/integration/service/plugin_test.go @@ -15,9 +15,9 @@ import ( "github.com/docker/docker/internal/test/daemon" "github.com/docker/docker/internal/test/fixtures/plugin" "github.com/docker/docker/internal/test/registry" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/poll" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/poll" + "gotest.tools/skip" ) func TestServicePlugin(t *testing.T) { diff --git a/integration/session/session_test.go b/integration/session/session_test.go index 893682fabaaa3ebedc9f86ed56d1825da76b12e9..67a3773abdb960072df1af6fe09bdf04af97fa72 100644 --- a/integration/session/session_test.go +++ b/integration/session/session_test.go @@ -5,9 +5,9 @@ import ( "testing" req "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestSessionCreate(t *testing.T) { diff --git a/integration/system/cgroupdriver_systemd_test.go b/integration/system/cgroupdriver_systemd_test.go index 0b4e7eeeeb1cb4df9bef27725930623202ccd2ce..449c83fdab6e791c808c025f0ce78989a331b04c 100644 --- a/integration/system/cgroupdriver_systemd_test.go +++ b/integration/system/cgroupdriver_systemd_test.go @@ -9,7 +9,7 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/daemon" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // hasSystemd checks whether the host was booted with systemd as its init diff --git a/integration/system/event_test.go b/integration/system/event_test.go index b1966fe6cef054c78cdcea4577227427a0dfe3d0..6e86f4ad95654248c9ede5d151e59f039a659a97 100644 --- a/integration/system/event_test.go +++ b/integration/system/event_test.go @@ -18,9 +18,9 @@ import ( "github.com/docker/docker/internal/test/request" req "github.com/docker/docker/internal/test/request" "github.com/docker/docker/pkg/jsonmessage" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestEventsExecDie(t *testing.T) { diff --git a/integration/system/info_linux_test.go b/integration/system/info_linux_test.go index 15bd69fdf61177cb95395b048e19febc996f2e0f..50fa9874b4f933a1d59aea607f39fd64f8be3813 100644 --- a/integration/system/info_linux_test.go +++ b/integration/system/info_linux_test.go @@ -9,8 +9,8 @@ import ( "github.com/docker/docker/internal/test/request" req "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestInfoBinaryCommits(t *testing.T) { diff --git a/integration/system/info_test.go b/integration/system/info_test.go index 0906eea33632585dac5d7c4c1c2a6a3c4e8b2762..2a05dfbb74993b42bac0edfa7eb597e5951400aa 100644 --- a/integration/system/info_test.go +++ b/integration/system/info_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestInfoAPI(t *testing.T) { diff --git a/integration/system/login_test.go b/integration/system/login_test.go index 5d512ca3432055ea3f91477585d0c346c16fd424..ad1a8756dc17335e588bfdc922acdb2902050beb 100644 --- a/integration/system/login_test.go +++ b/integration/system/login_test.go @@ -7,14 +7,14 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/integration/internal/requirement" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) // Test case for GitHub 22244 func TestLoginFailsWithBadCredentials(t *testing.T) { - skip.IfCondition(t, !requirement.HasHubConnectivity(t)) + skip.If(t, !requirement.HasHubConnectivity(t)) client := request.NewAPIClient(t) diff --git a/integration/system/version_test.go b/integration/system/version_test.go index 24618053604b4b6dab2fcfffe1d706d46f6b9811..8904c09b26c6fcd9a0bac2b31f1fa784598e2937 100644 --- a/integration/system/version_test.go +++ b/integration/system/version_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/docker/docker/internal/test/request" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestVersion(t *testing.T) { diff --git a/integration/volume/volume_test.go b/integration/volume/volume_test.go index 4acc6e8b1ae990fcc313d00676903e7bbff5a794..ce42bb3040b87524922d524103299fcc6d0647d5 100644 --- a/integration/volume/volume_test.go +++ b/integration/volume/volume_test.go @@ -13,9 +13,9 @@ import ( "github.com/docker/docker/integration/internal/container" "github.com/docker/docker/internal/test/request" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestVolumesCreateAndList(t *testing.T) { diff --git a/internal/test/daemon/config.go b/internal/test/daemon/config.go index c57010db90bf4c06e1571759c68b53921b6beccd..ce99222b37eace1718a7860a29d2d6491597033f 100644 --- a/internal/test/daemon/config.go +++ b/internal/test/daemon/config.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // ConfigConstructor defines a swarm config constructor diff --git a/internal/test/daemon/container.go b/internal/test/daemon/container.go index 6a0ced94472793624c36f17a91eb06d2fef984bb..3aa69e195cdc93920f3a69f066f5ed87c6d6761e 100644 --- a/internal/test/daemon/container.go +++ b/internal/test/daemon/container.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // ActiveContainers returns the list of ids of the currently running containers diff --git a/internal/test/daemon/daemon.go b/internal/test/daemon/daemon.go index a0d7ed4855f22dbebe7f442c8903c679b75aec52..98f1ee1b08b0d21d01a0259f4067fb7f933ed7a1 100644 --- a/internal/test/daemon/daemon.go +++ b/internal/test/daemon/daemon.go @@ -23,8 +23,8 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" - "github.com/gotestyourself/gotestyourself/assert" "github.com/pkg/errors" + "gotest.tools/assert" ) type testingT interface { diff --git a/internal/test/daemon/node.go b/internal/test/daemon/node.go index 5015c75eb1d7ef85747d0378a34f6016e8631a4f..d9263a7f29dc89724f3e36481d1d519f5baea8e4 100644 --- a/internal/test/daemon/node.go +++ b/internal/test/daemon/node.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // NodeConstructor defines a swarm node constructor diff --git a/internal/test/daemon/plugin.go b/internal/test/daemon/plugin.go index 9a7cc345ea74a7bd5002d702923aa022194ea0f3..63bbeed2193278392d316668c55958318292ddad 100644 --- a/internal/test/daemon/plugin.go +++ b/internal/test/daemon/plugin.go @@ -5,7 +5,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/client" - "github.com/gotestyourself/gotestyourself/poll" + "gotest.tools/poll" ) // PluginIsRunning provides a poller to check if the specified plugin is running diff --git a/internal/test/daemon/secret.go b/internal/test/daemon/secret.go index 615489bfd0a51e21da79075379bdecbc68705802..f3db7a42601da3ba0cde9f939d33084851cf80dc 100644 --- a/internal/test/daemon/secret.go +++ b/internal/test/daemon/secret.go @@ -6,7 +6,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // SecretConstructor defines a swarm secret constructor diff --git a/internal/test/daemon/service.go b/internal/test/daemon/service.go index 77614d0daafc107ef049b442366bd95e7c4314be..0f88ca786b32d944dc9891ed327aaaaed6a25d50 100644 --- a/internal/test/daemon/service.go +++ b/internal/test/daemon/service.go @@ -8,7 +8,7 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // ServiceConstructor defines a swarm service constructor function diff --git a/internal/test/daemon/swarm.go b/internal/test/daemon/swarm.go index 3e803eeeb87a2d1993a0a9de4823e679a1b6c911..e8e8b945dee3dc9d92f8326108db7df37a9cecbb 100644 --- a/internal/test/daemon/swarm.go +++ b/internal/test/daemon/swarm.go @@ -6,8 +6,8 @@ import ( "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" "github.com/pkg/errors" + "gotest.tools/assert" ) const ( diff --git a/internal/test/environment/clean.go b/internal/test/environment/clean.go index e92006fc46cf037d37238ef2bf9aed349ebced65..93dee593f281760f5ec167004aeaa743f927008c 100644 --- a/internal/test/environment/clean.go +++ b/internal/test/environment/clean.go @@ -9,7 +9,7 @@ import ( "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) type testingT interface { diff --git a/internal/test/environment/protect.go b/internal/test/environment/protect.go index 6d57dedb1ccde54f2c8a60e4bb54565038763a48..b5b27d2dd4f4c54722fe473c62cc5caad2ca039e 100644 --- a/internal/test/environment/protect.go +++ b/internal/test/environment/protect.go @@ -7,7 +7,7 @@ import ( "github.com/docker/docker/api/types/filters" dclient "github.com/docker/docker/client" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) var frozenImages = []string{"busybox:latest", "busybox:glibc", "hello-world:frozen", "debian:jessie"} diff --git a/internal/test/fakegit/fakegit.go b/internal/test/fakegit/fakegit.go index 59f4bcb056017856292afc404f8e471874f403f9..605d1baaa833721616d27993113f4d9f0c874cc8 100644 --- a/internal/test/fakegit/fakegit.go +++ b/internal/test/fakegit/fakegit.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/internal/test" "github.com/docker/docker/internal/test/fakecontext" "github.com/docker/docker/internal/test/fakestorage" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) type testingT interface { diff --git a/internal/test/fakestorage/fixtures.go b/internal/test/fakestorage/fixtures.go index a694834f7d895936cd4859ab06839f002d5b117b..ad8f76314338a404161d7a2a1c390bc0180e86f9 100644 --- a/internal/test/fakestorage/fixtures.go +++ b/internal/test/fakestorage/fixtures.go @@ -12,7 +12,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/internal/test" "github.com/docker/docker/pkg/archive" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) var ensureHTTPServerOnce sync.Once diff --git a/internal/test/fakestorage/storage.go b/internal/test/fakestorage/storage.go index adce3512c12f8e019bc0cecc8beaef18f5bbad2b..b091cbc3f1c85e70cc32c8b6b1fed6a2c4290f40 100644 --- a/internal/test/fakestorage/storage.go +++ b/internal/test/fakestorage/storage.go @@ -20,7 +20,7 @@ import ( "github.com/docker/docker/internal/test/request" "github.com/docker/docker/internal/testutil" "github.com/docker/go-connections/nat" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) var testEnv *environment.Execution diff --git a/internal/test/registry/registry.go b/internal/test/registry/registry.go index 2e89c32e57d6d81719e036883d4cc06465afbbed..b6128d3ba4d3c3deffd8a1942931be8242e9b85f 100644 --- a/internal/test/registry/registry.go +++ b/internal/test/registry/registry.go @@ -10,8 +10,8 @@ import ( "time" "github.com/docker/docker/internal/test" - "github.com/gotestyourself/gotestyourself/assert" "github.com/opencontainers/go-digest" + "gotest.tools/assert" ) const ( diff --git a/internal/test/request/request.go b/internal/test/request/request.go index 00450d94a22299d3fd9efc3a665b6d440ba37378..1986d370f152fdfc81fdd89db175e1d1e3c9008b 100644 --- a/internal/test/request/request.go +++ b/internal/test/request/request.go @@ -20,8 +20,8 @@ import ( "github.com/docker/docker/pkg/ioutils" "github.com/docker/go-connections/sockets" "github.com/docker/go-connections/tlsconfig" - "github.com/gotestyourself/gotestyourself/assert" "github.com/pkg/errors" + "gotest.tools/assert" ) // NewAPIClient returns a docker API client configured from environment variables diff --git a/internal/testutil/stringutils_test.go b/internal/testutil/stringutils_test.go index 1dd09af95f359a95abe3cff5dad2a4d20f97e4ed..753aac966dc2e3b25dab9d67932135770c47b12d 100644 --- a/internal/testutil/stringutils_test.go +++ b/internal/testutil/stringutils_test.go @@ -3,8 +3,8 @@ package testutil // import "github.com/docker/docker/internal/testutil" import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func testLengthHelper(generator func(int) string, t *testing.T) { diff --git a/libcontainerd/queue_test.go b/libcontainerd/queue_test.go index df5332c128b34dddd4ade3e0c5c64270e47896b0..e13afca89a25a89bc22d03bc79dc41c42c152ae3 100644 --- a/libcontainerd/queue_test.go +++ b/libcontainerd/queue_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestSerialization(t *testing.T) { diff --git a/opts/quotedstring_test.go b/opts/quotedstring_test.go index 21e6e4c85ae6e953a7b81ab8dd36aa5277c26471..89fed6cfa6ac3da6c84d832cae762176f5c8a718 100644 --- a/opts/quotedstring_test.go +++ b/opts/quotedstring_test.go @@ -3,8 +3,8 @@ package opts // import "github.com/docker/docker/opts" import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestQuotedStringSetWithQuotes(t *testing.T) { diff --git a/pkg/archive/archive_linux_test.go b/pkg/archive/archive_linux_test.go index b06cabecb330acc037e29016c400da975ca74803..9422269dffe7118065ca2956573dc0a680e66062 100644 --- a/pkg/archive/archive_linux_test.go +++ b/pkg/archive/archive_linux_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" "golang.org/x/sys/unix" + "gotest.tools/assert" + "gotest.tools/skip" ) // setupOverlayTestDir creates files in a directory with overlay whiteouts diff --git a/pkg/archive/archive_test.go b/pkg/archive/archive_test.go index d801f2724a17fe925f22797a651fda0753bfb6c9..9f06af9969c95de92fe4e827119e5ed6257ca771 100644 --- a/pkg/archive/archive_test.go +++ b/pkg/archive/archive_test.go @@ -18,9 +18,9 @@ import ( "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/ioutils" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) var tmp string diff --git a/pkg/archive/archive_unix_test.go b/pkg/archive/archive_unix_test.go index 034490b5731fa4d8e39f52ac9b5cc1702e005a68..808878d0948a46610bef712afd31e6d5f2593a14 100644 --- a/pkg/archive/archive_unix_test.go +++ b/pkg/archive/archive_unix_test.go @@ -13,10 +13,10 @@ import ( "testing" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) func TestCanonicalTarNameForPath(t *testing.T) { diff --git a/pkg/archive/changes_test.go b/pkg/archive/changes_test.go index 83ad5be605ef396d31ad063dee6c6fed80e66e79..f2527cd93650ffc786494892cea9710f0dc8b07a 100644 --- a/pkg/archive/changes_test.go +++ b/pkg/archive/changes_test.go @@ -11,8 +11,8 @@ import ( "time" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) func max(x, y int) int { diff --git a/pkg/archive/copy_unix_test.go b/pkg/archive/copy_unix_test.go index 08b1702cf1c25078ddf3b6878fa30ecbbd0e2993..739ad0e3eff4e332c5f192dff7d8c5aac16f4fcd 100644 --- a/pkg/archive/copy_unix_test.go +++ b/pkg/archive/copy_unix_test.go @@ -16,7 +16,7 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func removeAllPaths(paths ...string) { diff --git a/pkg/archive/wrap_test.go b/pkg/archive/wrap_test.go index 979536777ff356f25c69cab273295c3005b943fa..1faa7aed75393897581a55293584e24297a84ee7 100644 --- a/pkg/archive/wrap_test.go +++ b/pkg/archive/wrap_test.go @@ -6,7 +6,7 @@ import ( "io" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestGenerateEmptyFile(t *testing.T) { diff --git a/pkg/authorization/api_test.go b/pkg/authorization/api_test.go index 84964d2c5e86672972f5d5abe56bf9d74f3ab379..ff364fd0bcfd03704a3468e3a4ba5dbc1c1c7b6a 100644 --- a/pkg/authorization/api_test.go +++ b/pkg/authorization/api_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestPeerCertificateMarshalJSON(t *testing.T) { diff --git a/pkg/authorization/middleware_test.go b/pkg/authorization/middleware_test.go index e32e4bf4279d713e4545e740969760f988cf6a3f..6afafe082d3ba5822b52632d4483d51af606bcc3 100644 --- a/pkg/authorization/middleware_test.go +++ b/pkg/authorization/middleware_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/docker/docker/pkg/plugingetter" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestMiddleware(t *testing.T) { diff --git a/pkg/authorization/middleware_unix_test.go b/pkg/authorization/middleware_unix_test.go index 6d1a4284602b95db520affb4f8e70f2b446f0270..450e7fbbb73756ae05f15467af75427358dba2b4 100644 --- a/pkg/authorization/middleware_unix_test.go +++ b/pkg/authorization/middleware_unix_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/docker/docker/pkg/plugingetter" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestMiddlewareWrapHandler(t *testing.T) { diff --git a/pkg/chrootarchive/archive_test.go b/pkg/chrootarchive/archive_test.go index 3851d7224e5b884d794b7f42c86b3ceb50cb0434..5911a36158bf6a18120f4da6b992f7017073f495 100644 --- a/pkg/chrootarchive/archive_test.go +++ b/pkg/chrootarchive/archive_test.go @@ -16,7 +16,7 @@ import ( "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/reexec" "github.com/docker/docker/pkg/system" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/skip" ) func init() { diff --git a/pkg/fileutils/fileutils_test.go b/pkg/fileutils/fileutils_test.go index b167538d5a121793db9b04a7ac62fdff617ae73d..4b5f129a50afdd5bb5cf535a5048360fcca4c29b 100644 --- a/pkg/fileutils/fileutils_test.go +++ b/pkg/fileutils/fileutils_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // CopyFile with invalid src diff --git a/pkg/idtools/idtools_unix_test.go b/pkg/idtools/idtools_unix_test.go index 7d8c9715e238af8afe416b2506329697fda13840..608000a66b207ed270603102c5f4d3d1d085d410 100644 --- a/pkg/idtools/idtools_unix_test.go +++ b/pkg/idtools/idtools_unix_test.go @@ -10,10 +10,10 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/skip" "golang.org/x/sys/unix" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" + "gotest.tools/skip" ) const ( diff --git a/pkg/ioutils/readers_test.go b/pkg/ioutils/readers_test.go index e424054aa76c94ece065fa747fc2217dc385f83d..e645c78d83b1c1846aa5d2a40e40226cf1c3eaff 100644 --- a/pkg/ioutils/readers_test.go +++ b/pkg/ioutils/readers_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // Implement io.Reader diff --git a/pkg/jsonmessage/jsonmessage_test.go b/pkg/jsonmessage/jsonmessage_test.go index f9ead207cab4629926fc3d630207cc5e6b4fd119..223d9c7f5a82100e38bc52cc231da725e033b33d 100644 --- a/pkg/jsonmessage/jsonmessage_test.go +++ b/pkg/jsonmessage/jsonmessage_test.go @@ -9,8 +9,8 @@ import ( "time" "github.com/docker/docker/pkg/term" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestError(t *testing.T) { diff --git a/pkg/mount/mountinfo_linux_test.go b/pkg/mount/mountinfo_linux_test.go index f8acb9eeae7022a8c78c30ad42670ec4cb3baf09..64411ccaef1df0adf9ae34e05f4140462bcf0a93 100644 --- a/pkg/mount/mountinfo_linux_test.go +++ b/pkg/mount/mountinfo_linux_test.go @@ -6,7 +6,7 @@ import ( "bytes" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) const ( diff --git a/pkg/plugins/client_test.go b/pkg/plugins/client_test.go index d420010f1a1a56db975dfb8d4e8dcc942ddaf900..c3a4892272cd011704e20fd6cb4abe6615e83a89 100644 --- a/pkg/plugins/client_test.go +++ b/pkg/plugins/client_test.go @@ -14,9 +14,9 @@ import ( "github.com/docker/docker/pkg/plugins/transport" "github.com/docker/go-connections/tlsconfig" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/pkg/errors" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var ( diff --git a/pkg/plugins/discovery_unix_test.go b/pkg/plugins/discovery_unix_test.go index 2c718d8beedad0b0b6221fff7b2c47646ed247d9..b4aefc83e488a22556eadde6ab6e917240ac581d 100644 --- a/pkg/plugins/discovery_unix_test.go +++ b/pkg/plugins/discovery_unix_test.go @@ -11,7 +11,7 @@ import ( "reflect" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestLocalSocket(t *testing.T) { diff --git a/pkg/plugins/plugin_test.go b/pkg/plugins/plugin_test.go index ca8d5984007cda9dab1a63be1f150ed40d1ae7d3..ce98078f87c1712160fefda4b1cdd2e04e50c321 100644 --- a/pkg/plugins/plugin_test.go +++ b/pkg/plugins/plugin_test.go @@ -14,8 +14,8 @@ import ( "github.com/docker/docker/pkg/plugins/transport" "github.com/docker/go-connections/tlsconfig" - "github.com/gotestyourself/gotestyourself/assert" "github.com/pkg/errors" + "gotest.tools/assert" ) const ( diff --git a/pkg/plugins/transport/http_test.go b/pkg/plugins/transport/http_test.go index 081f60424d68fcb16409b75107e10a55095c963f..78ab23724b88dc5ff42b6269be4eafcb2b159c2b 100644 --- a/pkg/plugins/transport/http_test.go +++ b/pkg/plugins/transport/http_test.go @@ -5,8 +5,8 @@ import ( "net/http" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestHTTPTransport(t *testing.T) { diff --git a/pkg/pools/pools_test.go b/pkg/pools/pools_test.go index 76015169d42b2fe7086b93c54cc06b7f976ce4c0..7ff01ce3d5c85f33f455e42e47b6180b415c70a6 100644 --- a/pkg/pools/pools_test.go +++ b/pkg/pools/pools_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestBufioReaderPoolGetWithNoReaderShouldCreateOne(t *testing.T) { diff --git a/pkg/reexec/reexec_test.go b/pkg/reexec/reexec_test.go index 90aa01a390fd59f57051235e451684a26857b3cb..44675e7b6378bec664d1e2ae219f8f0448df49bb 100644 --- a/pkg/reexec/reexec_test.go +++ b/pkg/reexec/reexec_test.go @@ -5,7 +5,7 @@ import ( "os/exec" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func init() { diff --git a/pkg/signal/signal_linux_test.go b/pkg/signal/signal_linux_test.go index 71c577ed64aaa94dcda752e78819798f23c63d55..9a021e2164319d4893515b7737764f096515bd7f 100644 --- a/pkg/signal/signal_linux_test.go +++ b/pkg/signal/signal_linux_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestCatchAll(t *testing.T) { diff --git a/pkg/signal/signal_test.go b/pkg/signal/signal_test.go index bbf3736fc8c19262e84a90eba5604a90cfa06626..0bfcf6ce448dd2aecfb2d50567fd31aeb2ad5d9e 100644 --- a/pkg/signal/signal_test.go +++ b/pkg/signal/signal_test.go @@ -4,8 +4,8 @@ import ( "syscall" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestParseSignal(t *testing.T) { diff --git a/pkg/signal/trap_linux_test.go b/pkg/signal/trap_linux_test.go index a3afe7a7b6895a8d4fb71e3930bb3051447f46cd..14d1543117b15df599d5cdd8d43ab5edb87c170a 100644 --- a/pkg/signal/trap_linux_test.go +++ b/pkg/signal/trap_linux_test.go @@ -10,8 +10,8 @@ import ( "syscall" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func buildTestBinary(t *testing.T, tmpdir string, prefix string) (string, string) { diff --git a/pkg/streamformatter/streamformatter_test.go b/pkg/streamformatter/streamformatter_test.go index 172d568bda0c93a4c93d1fe86538489546bd1cf3..4399a6509b44414a9c6f687a97081947a4fb53d6 100644 --- a/pkg/streamformatter/streamformatter_test.go +++ b/pkg/streamformatter/streamformatter_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/pkg/jsonmessage" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestRawProgressFormatterFormatStatus(t *testing.T) { diff --git a/pkg/streamformatter/streamwriter_test.go b/pkg/streamformatter/streamwriter_test.go index b74d6fb2d3435e0a7bd3022bfe1acae01b7cf811..5b679f2cf48221c7315cac3768f4aad25f1e68fe 100644 --- a/pkg/streamformatter/streamwriter_test.go +++ b/pkg/streamformatter/streamwriter_test.go @@ -4,8 +4,8 @@ import ( "bytes" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestStreamWriterStdout(t *testing.T) { diff --git a/pkg/sysinfo/sysinfo_linux_test.go b/pkg/sysinfo/sysinfo_linux_test.go index e8a12a35c9a4458912c5e4240e084ec24373a7d4..13a07fbce93cfaa1d176c173fb811bb8c6288371 100644 --- a/pkg/sysinfo/sysinfo_linux_test.go +++ b/pkg/sysinfo/sysinfo_linux_test.go @@ -7,8 +7,8 @@ import ( "path/filepath" "testing" - "github.com/gotestyourself/gotestyourself/assert" "golang.org/x/sys/unix" + "gotest.tools/assert" ) func TestReadProcBool(t *testing.T) { diff --git a/pkg/system/rm_test.go b/pkg/system/rm_test.go index 19dc42cba9496c99e9029be714c90b2a5849571d..0448aac619de186a842749de0083f7838f75580e 100644 --- a/pkg/system/rm_test.go +++ b/pkg/system/rm_test.go @@ -9,7 +9,7 @@ import ( "time" "github.com/docker/docker/pkg/mount" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/skip" ) func TestEnsureRemoveAllNotExist(t *testing.T) { diff --git a/pkg/system/stat_unix_test.go b/pkg/system/stat_unix_test.go index fd68a9665652ddbf0600f0bd361028115d09522e..44e048f2a72303abbb1929a064862544c70ae668 100644 --- a/pkg/system/stat_unix_test.go +++ b/pkg/system/stat_unix_test.go @@ -7,7 +7,7 @@ import ( "syscall" "testing" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // TestFromStatT tests fromStatT for a tempfile diff --git a/pkg/tarsum/tarsum_test.go b/pkg/tarsum/tarsum_test.go index e1b38a6a1bc0738baa487551074c7ab60d604edb..435b91c78064841807d6ac145e1fc7503586bcaa 100644 --- a/pkg/tarsum/tarsum_test.go +++ b/pkg/tarsum/tarsum_test.go @@ -17,8 +17,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) type testLayer struct { diff --git a/pkg/term/ascii_test.go b/pkg/term/ascii_test.go index 321d1b87de3ba014026f289821612aa5dbe8cf45..665ab1552ff044a4182422d2ea749c5b31a6c2ee 100644 --- a/pkg/term/ascii_test.go +++ b/pkg/term/ascii_test.go @@ -3,8 +3,8 @@ package term // import "github.com/docker/docker/pkg/term" import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestToBytes(t *testing.T) { diff --git a/pkg/term/proxy_test.go b/pkg/term/proxy_test.go index 72f53e58d15c1e19958bb8226d0895088bd15b56..df588fe15bb00468797c9d8bea28a83259681406 100644 --- a/pkg/term/proxy_test.go +++ b/pkg/term/proxy_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestEscapeProxyRead(t *testing.T) { diff --git a/pkg/term/term_linux_test.go b/pkg/term/term_linux_test.go index 4f1d67586f1ec1d93c2a6ec73ab4030d1dbf0630..272395a10ea4686015fae9c52cf85eff4dce34aa 100644 --- a/pkg/term/term_linux_test.go +++ b/pkg/term/term_linux_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) // RequiresRoot skips tests that require root, unless the test.root flag has diff --git a/plugin/executor/containerd/containerd_test.go b/plugin/executor/containerd/containerd_test.go index d9185a05e1c540511d99b166c0b94cbd60feeadb..e27063b1d81f967055e6ff5bece8e06ff722e201 100644 --- a/plugin/executor/containerd/containerd_test.go +++ b/plugin/executor/containerd/containerd_test.go @@ -9,9 +9,9 @@ import ( "time" "github.com/docker/docker/libcontainerd" - "github.com/gotestyourself/gotestyourself/assert" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" + "gotest.tools/assert" ) func TestLifeCycle(t *testing.T) { diff --git a/plugin/manager_linux_test.go b/plugin/manager_linux_test.go index 740efd7a3ab5666aaaa67a95f6ad358fe67fcd72..fd8fa8523c23a02661e1f7b4667fbec639efb7c2 100644 --- a/plugin/manager_linux_test.go +++ b/plugin/manager_linux_test.go @@ -13,9 +13,9 @@ import ( "github.com/docker/docker/pkg/stringid" "github.com/docker/docker/pkg/system" "github.com/docker/docker/plugin/v2" - "github.com/gotestyourself/gotestyourself/skip" "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" + "gotest.tools/skip" ) func TestManagerWithPluginMounts(t *testing.T) { diff --git a/reference/store_test.go b/reference/store_test.go index 71f1d96e59e32714c8647cafc54cd7bed0983672..1ce674cbfbbd6ce70e4c133cd146645550b43ed1 100644 --- a/reference/store_test.go +++ b/reference/store_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/docker/distribution/reference" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" "github.com/opencontainers/go-digest" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) var ( diff --git a/registry/config_test.go b/registry/config_test.go index 2f9c9548eaf0ba150e7b710bb9acef6f2a32ed4c..30a257e3255638747a78054b0da17a8f9b8ff38e 100644 --- a/registry/config_test.go +++ b/registry/config_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestLoadAllowNondistributableArtifacts(t *testing.T) { diff --git a/registry/registry_test.go b/registry/registry_test.go index ec112523949c4181a830b5d6bcb766b84f2f4eaf..b7459471b3f64ea3f79ba99b86c770fbb9de6a9a 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -13,8 +13,8 @@ import ( "github.com/docker/distribution/registry/client/transport" "github.com/docker/docker/api/types" registrytypes "github.com/docker/docker/api/types/registry" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/assert" + "gotest.tools/skip" ) var ( diff --git a/registry/resumable/resumablerequestreader_test.go b/registry/resumable/resumablerequestreader_test.go index bd3d55885fb006a58263930076c07568f9ad8da9..c72c210e776e2ae47fd2cbf4b2796c7922485cc4 100644 --- a/registry/resumable/resumablerequestreader_test.go +++ b/registry/resumable/resumablerequestreader_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestResumableRequestHeaderSimpleErrors(t *testing.T) { diff --git a/registry/service_v1_test.go b/registry/service_v1_test.go index 590a653c3666b501b6f8d13cccb632fac6087df6..11861f7c0529648a6e488b9671f0790ef5a4fa5f 100644 --- a/registry/service_v1_test.go +++ b/registry/service_v1_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/skip" ) func TestLookupV1Endpoints(t *testing.T) { diff --git a/runconfig/config_test.go b/runconfig/config_test.go index 58e3a9f7884744dcbcd01c28e08511b5f36c10bd..67d386969f4da5926ce03f28503e1bc344e85c09 100644 --- a/runconfig/config_test.go +++ b/runconfig/config_test.go @@ -12,8 +12,8 @@ import ( "github.com/docker/docker/api/types/container" networktypes "github.com/docker/docker/api/types/network" "github.com/docker/docker/api/types/strslice" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) type f struct { diff --git a/runconfig/hostconfig_test.go b/runconfig/hostconfig_test.go index d2482fbe7b87cac13a483a181c6446aed23fde0f..b04cbc6bc3e65ba4b209a395d5f29590c7957abb 100644 --- a/runconfig/hostconfig_test.go +++ b/runconfig/hostconfig_test.go @@ -10,8 +10,8 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/sysinfo" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) // TODO Windows: This will need addressing for a Windows daemon. diff --git a/vendor.conf b/vendor.conf index 4ffb3edf56acd649e9fd5d772669b75709e1e3ce..3bd09b11a11156f4ef1e20278fb8925c2142af91 100644 --- a/vendor.conf +++ b/vendor.conf @@ -18,8 +18,7 @@ golang.org/x/sys 37707fdb30a5b38865cfb95e5aab41707daec7fd github.com/docker/go-units 9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1 github.com/docker/go-connections 7beb39f0b969b075d1325fecb092faf27fd357b6 golang.org/x/text f72d8390a633d5dfb0cc84043294db9f6c935756 -github.com/pmezard/go-difflib v1.0.0 -github.com/gotestyourself/gotestyourself cf3a5ab914a2efa8bc838d09f5918c1d44d029 +gotest.tools v2.1.0 github.com/google/go-cmp v0.2.0 github.com/RackSec/srslog 456df3a81436d29ba874f3590eeeee25d666f8a5 diff --git a/vendor/github.com/gotestyourself/gotestyourself/README.md b/vendor/github.com/gotestyourself/gotestyourself/README.md deleted file mode 100644 index aad893ae03362ac34799cafbd4286e741c1dd7be..0000000000000000000000000000000000000000 --- a/vendor/github.com/gotestyourself/gotestyourself/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Go Test Yourself - -A collection of packages compatible with `go test` to support common testing -patterns. - -[![GoDoc](https://godoc.org/github.com/gotestyourself/gotestyourself?status.svg)](https://godoc.org/github.com/gotestyourself/gotestyourself) -[![CircleCI](https://circleci.com/gh/gotestyourself/gotestyourself/tree/master.svg?style=shield)](https://circleci.com/gh/gotestyourself/gotestyourself/tree/master) -[![Go Reportcard](https://goreportcard.com/badge/github.com/gotestyourself/gotestyourself)](https://goreportcard.com/report/github.com/gotestyourself/gotestyourself) - - -## Packages - -* [assert](http://godoc.org/github.com/gotestyourself/gotestyourself/assert) - - compare values and fail the test when the comparison fails -* [env](http://godoc.org/github.com/gotestyourself/gotestyourself/env) - - test code that uses environment variables -* [fs](http://godoc.org/github.com/gotestyourself/gotestyourself/fs) - - create test files and directories -* [golden](http://godoc.org/github.com/gotestyourself/gotestyourself/golden) - - compare large multi-line strings -* [icmd](http://godoc.org/github.com/gotestyourself/gotestyourself/icmd) - - execute binaries and test the output -* [poll](http://godoc.org/github.com/gotestyourself/gotestyourself/poll) - - test asynchronous code by polling until a desired state is reached -* [skip](http://godoc.org/github.com/gotestyourself/gotestyourself/skip) - - skip tests based on conditions -* [testsum](http://godoc.org/github.com/gotestyourself/gotestyourself/testsum) - - a program to summarize `go test` output and test failures - -## Related - -* [maxbrunsfeld/counterfeiter](https://github.com/maxbrunsfeld/counterfeiter) - generate fakes for interfaces -* [jonboulle/clockwork](https://github.com/jonboulle/clockwork) - a fake clock for testing code that uses `time` diff --git a/vendor/github.com/pmezard/go-difflib/README.md b/vendor/github.com/pmezard/go-difflib/README.md deleted file mode 100644 index e87f307ed44fe4d73874eda51cb780c2b62bf611..0000000000000000000000000000000000000000 --- a/vendor/github.com/pmezard/go-difflib/README.md +++ /dev/null @@ -1,50 +0,0 @@ -go-difflib -========== - -[![Build Status](https://travis-ci.org/pmezard/go-difflib.png?branch=master)](https://travis-ci.org/pmezard/go-difflib) -[![GoDoc](https://godoc.org/github.com/pmezard/go-difflib/difflib?status.svg)](https://godoc.org/github.com/pmezard/go-difflib/difflib) - -Go-difflib is a partial port of python 3 difflib package. Its main goal -was to make unified and context diff available in pure Go, mostly for -testing purposes. - -The following class and functions (and related tests) have be ported: - -* `SequenceMatcher` -* `unified_diff()` -* `context_diff()` - -## Installation - -```bash -$ go get github.com/pmezard/go-difflib/difflib -``` - -### Quick Start - -Diffs are configured with Unified (or ContextDiff) structures, and can -be output to an io.Writer or returned as a string. - -```Go -diff := UnifiedDiff{ - A: difflib.SplitLines("foo\nbar\n"), - B: difflib.SplitLines("foo\nbaz\n"), - FromFile: "Original", - ToFile: "Current", - Context: 3, -} -text, _ := GetUnifiedDiffString(diff) -fmt.Printf(text) -``` - -would output: - -``` ---- Original -+++ Current -@@ -1,3 +1,3 @@ - foo --bar -+baz -``` - diff --git a/vendor/github.com/gotestyourself/gotestyourself/LICENSE b/vendor/gotest.tools/LICENSE similarity index 100% rename from vendor/github.com/gotestyourself/gotestyourself/LICENSE rename to vendor/gotest.tools/LICENSE diff --git a/vendor/gotest.tools/README.md b/vendor/gotest.tools/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f5df2043157f6dc144e3a7d5bb7f92ef26e8685e --- /dev/null +++ b/vendor/gotest.tools/README.md @@ -0,0 +1,31 @@ +# gotest.tools + +A collection of packages to augment `testing` and support common patterns. + +[![GoDoc](https://godoc.org/gotest.tools?status.svg)](https://godoc.org/gotest.tools) +[![CircleCI](https://circleci.com/gh/gotestyourself/gotestyourself/tree/master.svg?style=shield)](https://circleci.com/gh/gotestyourself/gotestyourself/tree/master) +[![Go Reportcard](https://goreportcard.com/badge/gotest.tools)](https://goreportcard.com/report/gotest.tools) + + +## Packages + +* [assert](http://godoc.org/gotest.tools/assert) - + compare values and fail the test when a comparison fails +* [env](http://godoc.org/gotest.tools/env) - + test code which uses environment variables +* [fs](http://godoc.org/gotest.tools/fs) - + create temporary files and compare a filesystem tree to an expected value +* [golden](http://godoc.org/gotest.tools/golden) - + compare large multi-line strings against values frozen in golden files +* [icmd](http://godoc.org/gotest.tools/icmd) - + execute binaries and test the output +* [poll](http://godoc.org/gotest.tools/poll) - + test asynchronous code by polling until a desired state is reached +* [skip](http://godoc.org/gotest.tools/skip) - + skip a test and print the source code of the condition used to skip the test + +## Related + +* [gotest.tools/gotestsum](https://github.com/gotestyourself/gotestsum) - go test runner with custom output +* [maxbrunsfeld/counterfeiter](https://github.com/maxbrunsfeld/counterfeiter) - generate fakes for interfaces +* [jonboulle/clockwork](https://github.com/jonboulle/clockwork) - a fake clock for testing code that uses `time` diff --git a/vendor/github.com/gotestyourself/gotestyourself/assert/assert.go b/vendor/gotest.tools/assert/assert.go similarity index 85% rename from vendor/github.com/gotestyourself/gotestyourself/assert/assert.go rename to vendor/gotest.tools/assert/assert.go index d2b05f41655abca695d1a308a4036a4d41e83ebf..05d6635436f7841fa59bfdb1c8bc535e340a9da8 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/assert/assert.go +++ b/vendor/gotest.tools/assert/assert.go @@ -8,7 +8,7 @@ comparison fails. The one difference is that Assert() will end the test executio immediately (using t.FailNow()) whereas Check() will fail the test (using t.Fail()), return the value of the comparison, then proceed with the rest of the test case. -Example Usage +Example usage The example below shows assert used with some common types. @@ -16,8 +16,8 @@ The example below shows assert used with some common types. import ( "testing" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestEverything(t *testing.T) { @@ -49,12 +49,20 @@ The example below shows assert used with some common types. Comparisons -https://godoc.org/github.com/gotestyourself/gotestyourself/assert/cmp provides +Package https://godoc.org/gotest.tools/assert/cmp provides many common comparisons. Additional comparisons can be written to compare values in other ways. See the example Assert (CustomComparison). +Automated migration from testify + +gty-migrate-from-testify is a binary which can update source code which uses +testify assertions to use the assertions provided by this package. + +See http://bit.do/cmd-gty-migrate-from-testify. + + */ -package assert +package assert // import "gotest.tools/assert" import ( "fmt" @@ -62,9 +70,9 @@ import ( "go/token" gocmp "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/internal/format" - "github.com/gotestyourself/gotestyourself/internal/source" + "gotest.tools/assert/cmp" + "gotest.tools/internal/format" + "gotest.tools/internal/source" ) // BoolOrComparison can be a bool, or cmp.Comparison. See Assert() for usage. @@ -234,7 +242,17 @@ func NilError(t TestingT, err error, msgAndArgs ...interface{}) { } // Equal uses the == operator to assert two values are equal and fails the test -// if they are not equal. This is equivalent to Assert(t, cmp.Equal(x, y)). +// if they are not equal. +// +// If the comparison fails Equal will use the variable names for x and y as part +// of the failure message to identify the actual and expected values. +// +// If either x or y are a multi-line string the failure message will include a +// unified diff of the two values. If the values only differ by whitespace +// the unified diff will be augmented by replacing whitespace characters with +// visible characters to identify the whitespace difference. +// +// This is equivalent to Assert(t, cmp.Equal(x, y)). func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() @@ -242,8 +260,12 @@ func Equal(t TestingT, x, y interface{}, msgAndArgs ...interface{}) { assert(t, t.FailNow, argsAfterT, cmp.Equal(x, y), msgAndArgs...) } -// DeepEqual uses https://github.com/google/go-cmp/cmp to assert two values -// are equal and fails the test if they are not equal. +// DeepEqual uses google/go-cmp (http://bit.do/go-cmp) to assert two values are +// equal and fails the test if they are not equal. +// +// Package https://godoc.org/gotest.tools/assert/opt provides some additional +// commonly used Options. +// // This is equivalent to Assert(t, cmp.DeepEqual(x, y)). func DeepEqual(t TestingT, x, y interface{}, opts ...gocmp.Option) { if ht, ok := t.(helperT); ok { @@ -276,7 +298,7 @@ func ErrorContains(t TestingT, err error, substring string, msgAndArgs ...interf // // Expected can be one of: // a func(error) bool which returns true if the error is the expected type, -// an instance of a struct of the expected type, +// an instance of (or a pointer to) a struct of the expected type, // a pointer to an interface the error is expected to implement, // a reflect.Type of the expected struct or interface. // diff --git a/vendor/github.com/gotestyourself/gotestyourself/assert/cmp/compare.go b/vendor/gotest.tools/assert/cmp/compare.go similarity index 90% rename from vendor/github.com/gotestyourself/gotestyourself/assert/cmp/compare.go rename to vendor/gotest.tools/assert/cmp/compare.go index 64a25f00b339b41d1d62dbfd02867917aef3a68c..ae03749e203b626f01fefa4c575cb18d52871db2 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/assert/cmp/compare.go +++ b/vendor/gotest.tools/assert/cmp/compare.go @@ -1,5 +1,5 @@ /*Package cmp provides Comparisons for Assert and Check*/ -package cmp +package cmp // import "gotest.tools/assert/cmp" import ( "fmt" @@ -7,7 +7,7 @@ import ( "strings" "github.com/google/go-cmp/cmp" - "github.com/pmezard/go-difflib/difflib" + "gotest.tools/internal/format" ) // Comparison is a function which compares values and returns ResultSuccess if @@ -15,10 +15,12 @@ import ( // Result will contain a message about why it failed. type Comparison func() Result -// DeepEqual compares two values using https://godoc.org/github.com/google/go-cmp/cmp +// DeepEqual compares two values using google/go-cmp (http://bit.do/go-cmp) // and succeeds if the values are equal. // // The comparison can be customized using comparison Options. +// Package https://godoc.org/gotest.tools/assert/opt provides some additional +// commonly used Options. func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison { return func() (result Result) { defer func() { @@ -27,7 +29,10 @@ func DeepEqual(x, y interface{}, opts ...cmp.Option) Comparison { } }() diff := cmp.Diff(x, y, opts...) - return toResult(diff == "", "\n"+diff) + if diff == "" { + return ResultSuccess + } + return multiLineDiffResult(diff) } } @@ -53,14 +58,15 @@ func toResult(success bool, msg string) Result { return ResultFailure(msg) } -// Equal succeeds if x == y. +// Equal succeeds if x == y. See assert.Equal for full documentation. func Equal(x, y interface{}) Comparison { return func() Result { switch { case x == y: return ResultSuccess case isMultiLineStringCompare(x, y): - return multiLineStringDiffResult(x.(string), y.(string)) + diff := format.UnifiedDiff(format.DiffConfig{A: x.(string), B: y.(string)}) + return multiLineDiffResult(diff) } return ResultFailureTemplate(` {{- .Data.x}} ( @@ -86,15 +92,7 @@ func isMultiLineStringCompare(x, y interface{}) bool { return strings.Contains(strX, "\n") || strings.Contains(strY, "\n") } -func multiLineStringDiffResult(x, y string) Result { - diff, err := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{ - A: difflib.SplitLines(x), - B: difflib.SplitLines(y), - Context: 3, - }) - if err != nil { - return ResultFailure(fmt.Sprintf("failed to diff: %s", err)) - } +func multiLineDiffResult(diff string) Result { return ResultFailureTemplate(` --- {{ with callArg 0 }}{{ formatNode . }}{{else}}←{{end}} +++ {{ with callArg 1 }}{{ formatNode . }}{{else}}→{{end}} @@ -242,7 +240,7 @@ func isNil(obj interface{}, msgFunc func(reflect.Value) string) Comparison { // // Expected can be one of: // a func(error) bool which returns true if the error is the expected type, -// an instance of a struct of the expected type, +// an instance of (or a pointer to) a struct of the expected type, // a pointer to an interface the error is expected to implement, // a reflect.Type of the expected struct or interface. func ErrorType(err error, expected interface{}) Comparison { @@ -261,7 +259,7 @@ func ErrorType(err error, expected interface{}) Comparison { expectedType := reflect.TypeOf(expected) switch { - case expectedType.Kind() == reflect.Struct: + case expectedType.Kind() == reflect.Struct, isPtrToStruct(expectedType): return cmpErrorTypeEqualType(err, expectedType) case isPtrToInterface(expectedType): return cmpErrorTypeImplementsType(err, expectedType.Elem()) @@ -308,3 +306,7 @@ func cmpErrorTypeImplementsType(err error, expectedType reflect.Type) Result { func isPtrToInterface(typ reflect.Type) bool { return typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Interface } + +func isPtrToStruct(typ reflect.Type) bool { + return typ.Kind() == reflect.Ptr && typ.Elem().Kind() == reflect.Struct +} diff --git a/vendor/github.com/gotestyourself/gotestyourself/assert/cmp/result.go b/vendor/gotest.tools/assert/cmp/result.go similarity index 97% rename from vendor/github.com/gotestyourself/gotestyourself/assert/cmp/result.go rename to vendor/gotest.tools/assert/cmp/result.go index 99f39eeb2749e87fbc5f79dc4892b8663fc959ec..7c3c37dd721a7e88ae0e088afb17f2af7671665c 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/assert/cmp/result.go +++ b/vendor/gotest.tools/assert/cmp/result.go @@ -6,7 +6,7 @@ import ( "go/ast" "text/template" - "github.com/gotestyourself/gotestyourself/internal/source" + "gotest.tools/internal/source" ) // Result of a Comparison. diff --git a/vendor/github.com/gotestyourself/gotestyourself/assert/result.go b/vendor/gotest.tools/assert/result.go similarity index 93% rename from vendor/github.com/gotestyourself/gotestyourself/assert/result.go rename to vendor/gotest.tools/assert/result.go index b685b7f3e5c130eccc4fce4e06d7f37920573a6c..3900264d0bfa11dd377f63b3f47722bd47e21f52 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/assert/result.go +++ b/vendor/gotest.tools/assert/result.go @@ -4,9 +4,9 @@ import ( "fmt" "go/ast" - "github.com/gotestyourself/gotestyourself/assert/cmp" - "github.com/gotestyourself/gotestyourself/internal/format" - "github.com/gotestyourself/gotestyourself/internal/source" + "gotest.tools/assert/cmp" + "gotest.tools/internal/format" + "gotest.tools/internal/source" ) func runComparison( diff --git a/vendor/github.com/gotestyourself/gotestyourself/env/env.go b/vendor/gotest.tools/env/env.go similarity index 84% rename from vendor/github.com/gotestyourself/gotestyourself/env/env.go rename to vendor/gotest.tools/env/env.go index 700430f1dd131f972273499f87291d2c64528932..ed0f18991613383f37ab96821644ff0752590586 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/env/env.go +++ b/vendor/gotest.tools/env/env.go @@ -1,13 +1,14 @@ /*Package env provides functions to test code that read environment variables or the current working directory. */ -package env +package env // import "gotest.tools/env" import ( "os" "strings" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" + "gotest.tools/x/subtest" ) type helperT interface { @@ -23,7 +24,7 @@ func Patch(t assert.TestingT, key, value string) func() { } oldValue, ok := os.LookupEnv(key) assert.NilError(t, os.Setenv(key, value)) - return func() { + cleanup := func() { if ht, ok := t.(helperT); ok { ht.Helper() } @@ -33,6 +34,10 @@ func Patch(t assert.TestingT, key, value string) func() { } assert.NilError(t, os.Setenv(key, oldValue)) } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(cleanup) + } + return cleanup } // PatchAll sets the environment to env, and returns a function which will @@ -47,7 +52,7 @@ func PatchAll(t assert.TestingT, env map[string]string) func() { for key, value := range env { assert.NilError(t, os.Setenv(key, value), "setenv %s=%s", key, value) } - return func() { + cleanup := func() { if ht, ok := t.(helperT); ok { ht.Helper() } @@ -56,6 +61,10 @@ func PatchAll(t assert.TestingT, env map[string]string) func() { assert.NilError(t, os.Setenv(key, oldVal), "setenv %s=%s", key, oldVal) } } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(cleanup) + } + return cleanup } // ToMap takes a list of strings in the format returned by os.Environ() and @@ -89,10 +98,14 @@ func ChangeWorkingDir(t assert.TestingT, dir string) func() { cwd, err := os.Getwd() assert.NilError(t, err) assert.NilError(t, os.Chdir(dir)) - return func() { + cleanup := func() { if ht, ok := t.(helperT); ok { ht.Helper() } assert.NilError(t, os.Chdir(cwd)) } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(cleanup) + } + return cleanup } diff --git a/vendor/github.com/gotestyourself/gotestyourself/fs/file.go b/vendor/gotest.tools/fs/file.go similarity index 77% rename from vendor/github.com/gotestyourself/gotestyourself/fs/file.go rename to vendor/gotest.tools/fs/file.go index a2f731093b02d08d968964d689c30788e84281f2..8bf0188d2f0cdc5c1d060ef8e7f1f792619f5389 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/fs/file.go +++ b/vendor/gotest.tools/fs/file.go @@ -1,17 +1,20 @@ -/*Package fs provides tools for creating and working with temporary files and -directories. +/*Package fs provides tools for creating temporary files, and testing the +contents and structure of a directory. */ -package fs +package fs // import "gotest.tools/fs" import ( "io/ioutil" "os" "path/filepath" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" + "gotest.tools/x/subtest" ) -// Path objects return their filesystem path. Both File and Dir implement Path. +// Path objects return their filesystem path. Path may be implemented by a +// real filesystem object (such as File and Dir) or by a type which updates +// entries in a Manifest. type Path interface { Path() string Remove() @@ -45,6 +48,9 @@ func NewFile(t assert.TestingT, prefix string, ops ...PathOp) *File { for _, op := range ops { assert.NilError(t, op(file)) } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(file.Remove) + } return file } @@ -77,6 +83,9 @@ func NewDir(t assert.TestingT, prefix string, ops ...PathOp) *Dir { for _, op := range ops { assert.NilError(t, op(dir)) } + if tc, ok := t.(subtest.TestContext); ok { + tc.AddCleanup(dir.Remove) + } return dir } diff --git a/vendor/gotest.tools/fs/manifest.go b/vendor/gotest.tools/fs/manifest.go new file mode 100644 index 0000000000000000000000000000000000000000..00976ef19c9b92c80d762738e64d72377b957755 --- /dev/null +++ b/vendor/gotest.tools/fs/manifest.go @@ -0,0 +1,129 @@ +package fs + +import ( + "io" + "io/ioutil" + "os" + "path/filepath" + + "github.com/pkg/errors" + "gotest.tools/assert" +) + +// Manifest stores the expected structure and properties of files and directories +// in a filesystem. +type Manifest struct { + root *directory +} + +type resource struct { + mode os.FileMode + uid uint32 + gid uint32 +} + +type file struct { + resource + content io.ReadCloser +} + +func (f *file) Type() string { + return "file" +} + +type symlink struct { + resource + target string +} + +func (f *symlink) Type() string { + return "symlink" +} + +type directory struct { + resource + items map[string]dirEntry +} + +func (f *directory) Type() string { + return "directory" +} + +type dirEntry interface { + Type() string +} + +// ManifestFromDir creates a Manifest by reading the directory at path. The +// manifest stores the structure and properties of files in the directory. +// ManifestFromDir can be used with Equal to compare two directories. +func ManifestFromDir(t assert.TestingT, path string) Manifest { + if ht, ok := t.(helperT); ok { + ht.Helper() + } + + manifest, err := manifestFromDir(path) + assert.NilError(t, err) + return manifest +} + +func manifestFromDir(path string) (Manifest, error) { + info, err := os.Stat(path) + switch { + case err != nil: + return Manifest{}, err + case !info.IsDir(): + return Manifest{}, errors.Errorf("path %s must be a directory", path) + } + + directory, err := newDirectory(path, info) + return Manifest{root: directory}, err +} + +func newDirectory(path string, info os.FileInfo) (*directory, error) { + items := make(map[string]dirEntry) + children, err := ioutil.ReadDir(path) + if err != nil { + return nil, err + } + for _, child := range children { + fullPath := filepath.Join(path, child.Name()) + items[child.Name()], err = getTypedResource(fullPath, child) + if err != nil { + return nil, err + } + } + + return &directory{ + resource: newResourceFromInfo(info), + items: items, + }, nil +} + +func getTypedResource(path string, info os.FileInfo) (dirEntry, error) { + switch { + case info.IsDir(): + return newDirectory(path, info) + case info.Mode()&os.ModeSymlink != 0: + return newSymlink(path, info) + // TODO: devices, pipes? + default: + return newFile(path, info) + } +} + +func newSymlink(path string, info os.FileInfo) (*symlink, error) { + target, err := os.Readlink(path) + return &symlink{ + resource: newResourceFromInfo(info), + target: target, + }, err +} + +func newFile(path string, info os.FileInfo) (*file, error) { + // TODO: defer file opening to reduce number of open FDs? + readCloser, err := os.Open(path) + return &file{ + resource: newResourceFromInfo(info), + content: readCloser, + }, err +} diff --git a/vendor/gotest.tools/fs/manifest_unix.go b/vendor/gotest.tools/fs/manifest_unix.go new file mode 100644 index 0000000000000000000000000000000000000000..bba2fcd9df8df54766ea9fb44c65b9679eb39a8b --- /dev/null +++ b/vendor/gotest.tools/fs/manifest_unix.go @@ -0,0 +1,30 @@ +// +build !windows + +package fs + +import ( + "os" + "syscall" +) + +const ( + defaultRootDirMode = os.ModeDir | 0700 + defaultSymlinkMode = os.ModeSymlink | 0777 +) + +func newResourceFromInfo(info os.FileInfo) resource { + statT := info.Sys().(*syscall.Stat_t) + return resource{ + mode: info.Mode(), + uid: statT.Uid, + gid: statT.Gid, + } +} + +func (p *filePath) SetMode(mode os.FileMode) { + p.file.mode = mode +} + +func (p *directoryPath) SetMode(mode os.FileMode) { + p.directory.mode = mode | os.ModeDir +} diff --git a/vendor/gotest.tools/fs/manifest_windows.go b/vendor/gotest.tools/fs/manifest_windows.go new file mode 100644 index 0000000000000000000000000000000000000000..1c1a0936795dd9889d3a478d303082f81bfe1319 --- /dev/null +++ b/vendor/gotest.tools/fs/manifest_windows.go @@ -0,0 +1,22 @@ +package fs + +import "os" + +const ( + defaultRootDirMode = os.ModeDir | 0777 + defaultSymlinkMode = os.ModeSymlink | 0666 +) + +func newResourceFromInfo(info os.FileInfo) resource { + return resource{mode: info.Mode()} +} + +func (p *filePath) SetMode(mode os.FileMode) { + bits := mode & 0600 + p.file.mode = bits + bits/010 + bits/0100 +} + +// TODO: is mode ignored on windows? +func (p *directoryPath) SetMode(mode os.FileMode) { + p.directory.mode = defaultRootDirMode +} diff --git a/vendor/github.com/gotestyourself/gotestyourself/fs/ops.go b/vendor/gotest.tools/fs/ops.go similarity index 61% rename from vendor/github.com/gotestyourself/gotestyourself/fs/ops.go rename to vendor/gotest.tools/fs/ops.go index bf9d2150b355ed3faa6a5aad9af3202de585ef15..ec9d11c1100be314cab6b26b1a8a5958c17f51a5 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/fs/ops.go +++ b/vendor/gotest.tools/fs/ops.go @@ -1,32 +1,73 @@ package fs import ( + "bytes" + "io" "io/ioutil" "os" "path/filepath" + "strings" "time" + + "github.com/pkg/errors" ) -// PathOp is a function which accepts a Path to perform some operation +const defaultFileMode = 0644 + +// PathOp is a function which accepts a Path and performs an operation on that +// path. When called with real filesystem objects (File or Dir) a PathOp modifies +// the filesystem at the path. When used with a Manifest object a PathOp updates +// the manifest to expect a value. type PathOp func(path Path) error +type manifestResource interface { + SetMode(mode os.FileMode) + SetUID(uid uint32) + SetGID(gid uint32) +} + +type manifestFile interface { + manifestResource + SetContent(content io.ReadCloser) +} + +type manifestDirectory interface { + manifestResource + AddSymlink(path, target string) error + AddFile(path string, ops ...PathOp) error + AddDirectory(path string, ops ...PathOp) error +} + // WithContent writes content to a file at Path func WithContent(content string) PathOp { return func(path Path) error { - return ioutil.WriteFile(path.Path(), []byte(content), 0644) + if m, ok := path.(manifestFile); ok { + m.SetContent(ioutil.NopCloser(strings.NewReader(content))) + return nil + } + return ioutil.WriteFile(path.Path(), []byte(content), defaultFileMode) } } // WithBytes write bytes to a file at Path func WithBytes(raw []byte) PathOp { return func(path Path) error { - return ioutil.WriteFile(path.Path(), raw, 0644) + if m, ok := path.(manifestFile); ok { + m.SetContent(ioutil.NopCloser(bytes.NewReader(raw))) + return nil + } + return ioutil.WriteFile(path.Path(), raw, defaultFileMode) } } // AsUser changes ownership of the file system object at Path func AsUser(uid, gid int) PathOp { return func(path Path) error { + if m, ok := path.(manifestResource); ok { + m.SetUID(uint32(uid)) + m.SetGID(uint32(gid)) + return nil + } return os.Chown(path.Path(), uid, gid) } } @@ -34,6 +75,11 @@ func AsUser(uid, gid int) PathOp { // WithFile creates a file in the directory at path with content func WithFile(filename, content string, ops ...PathOp) PathOp { return func(path Path) error { + if m, ok := path.(manifestDirectory); ok { + ops = append([]PathOp{WithContent(content), WithMode(defaultFileMode)}, ops...) + return m.AddFile(filename, ops...) + } + fullpath := filepath.Join(path.Path(), filepath.FromSlash(filename)) if err := createFile(fullpath, content); err != nil { return err @@ -43,12 +89,22 @@ func WithFile(filename, content string, ops ...PathOp) PathOp { } func createFile(fullpath string, content string) error { - return ioutil.WriteFile(fullpath, []byte(content), 0644) + return ioutil.WriteFile(fullpath, []byte(content), defaultFileMode) } // WithFiles creates all the files in the directory at path with their content func WithFiles(files map[string]string) PathOp { return func(path Path) error { + if m, ok := path.(manifestDirectory); ok { + for filename, content := range files { + // TODO: remove duplication with WithFile + if err := m.AddFile(filename, WithContent(content), WithMode(defaultFileMode)); err != nil { + return err + } + } + return nil + } + for filename, content := range files { fullpath := filepath.Join(path.Path(), filepath.FromSlash(filename)) if err := createFile(fullpath, content); err != nil { @@ -62,6 +118,9 @@ func WithFiles(files map[string]string) PathOp { // FromDir copies the directory tree from the source path into the new Dir func FromDir(source string) PathOp { return func(path Path) error { + if _, ok := path.(manifestDirectory); ok { + return errors.New("use manifest.FromDir") + } return copyDirectory(source, path.Path()) } } @@ -69,9 +128,15 @@ func FromDir(source string) PathOp { // WithDir creates a subdirectory in the directory at path. Additional PathOp // can be used to modify the subdirectory func WithDir(name string, ops ...PathOp) PathOp { + const defaultMode = 0755 return func(path Path) error { + if m, ok := path.(manifestDirectory); ok { + ops = append([]PathOp{WithMode(defaultMode)}, ops...) + return m.AddDirectory(name, ops...) + } + fullpath := filepath.Join(path.Path(), filepath.FromSlash(name)) - err := os.MkdirAll(fullpath, 0755) + err := os.MkdirAll(fullpath, defaultMode) if err != nil { return err } @@ -91,6 +156,10 @@ func applyPathOps(path Path, ops []PathOp) error { // WithMode sets the file mode on the directory or file at path func WithMode(mode os.FileMode) PathOp { return func(path Path) error { + if m, ok := path.(manifestResource); ok { + m.SetMode(mode) + return nil + } return os.Chmod(path.Path(), mode) } } @@ -112,6 +181,7 @@ func copyDirectory(source, dest string) error { } continue } + // TODO: handle symlinks if err := copyFile(sourcePath, destPath); err != nil { return err } @@ -134,6 +204,9 @@ func copyFile(source, dest string) error { // the other functions in this package. func WithSymlink(path, target string) PathOp { return func(root Path) error { + if v, ok := root.(manifestDirectory); ok { + return v.AddSymlink(path, target) + } return os.Symlink(filepath.Join(root.Path(), target), filepath.Join(root.Path(), path)) } } @@ -145,6 +218,9 @@ func WithSymlink(path, target string) PathOp { // the other functions in this package. func WithHardlink(path, target string) PathOp { return func(root Path) error { + if _, ok := root.(manifestDirectory); ok { + return errors.New("WithHardlink yet implemented for manifests") + } return os.Link(filepath.Join(root.Path(), target), filepath.Join(root.Path(), path)) } } @@ -153,6 +229,9 @@ func WithHardlink(path, target string) PathOp { // at path. func WithTimestamps(atime, mtime time.Time) PathOp { return func(root Path) error { + if _, ok := root.(manifestDirectory); ok { + return errors.New("WithTimestamp yet implemented for manifests") + } return os.Chtimes(root.Path(), atime, mtime) } } diff --git a/vendor/gotest.tools/fs/path.go b/vendor/gotest.tools/fs/path.go new file mode 100644 index 0000000000000000000000000000000000000000..baf777f0dfcc41812689785f10132682026ef5c2 --- /dev/null +++ b/vendor/gotest.tools/fs/path.go @@ -0,0 +1,151 @@ +package fs + +import ( + "bytes" + "io" + "io/ioutil" + "os" + + "gotest.tools/assert" +) + +// resourcePath is an adaptor for resources so they can be used as a Path +// with PathOps. +type resourcePath struct{} + +func (p *resourcePath) Path() string { + return "manifest: not a filesystem path" +} + +func (p *resourcePath) Remove() {} + +type filePath struct { + resourcePath + file *file +} + +func (p *filePath) SetContent(content io.ReadCloser) { + p.file.content = content +} + +func (p *filePath) SetUID(uid uint32) { + p.file.uid = uid +} + +func (p *filePath) SetGID(gid uint32) { + p.file.gid = gid +} + +type directoryPath struct { + resourcePath + directory *directory +} + +func (p *directoryPath) SetUID(uid uint32) { + p.directory.uid = uid +} + +func (p *directoryPath) SetGID(gid uint32) { + p.directory.gid = gid +} + +func (p *directoryPath) AddSymlink(path, target string) error { + p.directory.items[path] = &symlink{ + resource: newResource(defaultSymlinkMode), + target: target, + } + return nil +} + +func (p *directoryPath) AddFile(path string, ops ...PathOp) error { + newFile := &file{resource: newResource(0)} + p.directory.items[path] = newFile + exp := &filePath{file: newFile} + return applyPathOps(exp, ops) +} + +func (p *directoryPath) AddDirectory(path string, ops ...PathOp) error { + newDir := newDirectoryWithDefaults() + p.directory.items[path] = newDir + exp := &directoryPath{directory: newDir} + return applyPathOps(exp, ops) +} + +// Expected returns a Manifest with a directory structured created by ops. The +// PathOp operations are applied to the manifest as expectations of the +// filesystem structure and properties. +func Expected(t assert.TestingT, ops ...PathOp) Manifest { + if ht, ok := t.(helperT); ok { + ht.Helper() + } + + newDir := newDirectoryWithDefaults() + e := &directoryPath{directory: newDir} + assert.NilError(t, applyPathOps(e, ops)) + return Manifest{root: newDir} +} + +func newDirectoryWithDefaults() *directory { + return &directory{ + resource: newResource(defaultRootDirMode), + items: make(map[string]dirEntry), + } +} + +func newResource(mode os.FileMode) resource { + return resource{ + mode: mode, + uid: currentUID(), + gid: currentGID(), + } +} + +func currentUID() uint32 { + return normalizeID(os.Getuid()) +} + +func currentGID() uint32 { + return normalizeID(os.Getgid()) +} + +func normalizeID(id int) uint32 { + // ids will be -1 on windows + if id < 0 { + return 0 + } + return uint32(id) +} + +var anyFileContent = ioutil.NopCloser(bytes.NewReader(nil)) + +// MatchAnyFileContent is a PathOp that updates a Manifest so that the file +// at path may contain any content. +func MatchAnyFileContent(path Path) error { + if m, ok := path.(*filePath); ok { + m.SetContent(anyFileContent) + } + return nil +} + +const anyFile = "*" + +// MatchExtraFiles is a PathOp that updates a Manifest to allow a directory +// to contain unspecified files. +func MatchExtraFiles(path Path) error { + if m, ok := path.(*directoryPath); ok { + m.AddFile(anyFile) + } + return nil +} + +// anyFileMode is represented by uint32_max +const anyFileMode os.FileMode = 4294967295 + +// MatchAnyFileMode is a PathOp that updates a Manifest so that the resource at path +// will match any file mode. +func MatchAnyFileMode(path Path) error { + if m, ok := path.(manifestResource); ok { + m.SetMode(anyFileMode) + } + return nil +} diff --git a/vendor/gotest.tools/fs/report.go b/vendor/gotest.tools/fs/report.go new file mode 100644 index 0000000000000000000000000000000000000000..4de85a6ef7318d69f0de2948a728894cb1a09cc8 --- /dev/null +++ b/vendor/gotest.tools/fs/report.go @@ -0,0 +1,215 @@ +package fs + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "sort" + "strings" + + "gotest.tools/assert/cmp" + "gotest.tools/internal/format" +) + +// Equal compares a directory to the expected structured described by a manifest +// and returns success if they match. If they do not match the failure message +// will contain all the differences between the directory structure and the +// expected structure defined by the Manifest. +// +// Equal is a cmp.Comparison which can be used with assert.Assert(). +func Equal(path string, expected Manifest) cmp.Comparison { + return func() cmp.Result { + actual, err := manifestFromDir(path) + if err != nil { + return cmp.ResultFromError(err) + } + failures := eqDirectory(string(os.PathSeparator), expected.root, actual.root) + if len(failures) == 0 { + return cmp.ResultSuccess + } + msg := fmt.Sprintf("directory %s does not match expected:\n", path) + return cmp.ResultFailure(msg + formatFailures(failures)) + } +} + +type failure struct { + path string + problems []problem +} + +type problem string + +func notEqual(property string, x, y interface{}) problem { + return problem(fmt.Sprintf("%s: expected %s got %s", property, x, y)) +} + +func errProblem(reason string, err error) problem { + return problem(fmt.Sprintf("%s: %s", reason, err)) +} + +func existenceProblem(filename, reason string, args ...interface{}) problem { + return problem(filename + ": " + fmt.Sprintf(reason, args...)) +} + +func eqResource(x, y resource) []problem { + var p []problem + if x.uid != y.uid { + p = append(p, notEqual("uid", x.uid, y.uid)) + } + if x.gid != y.gid { + p = append(p, notEqual("gid", x.gid, y.gid)) + } + if x.mode != anyFileMode && x.mode != y.mode { + p = append(p, notEqual("mode", x.mode, y.mode)) + } + return p +} + +func eqFile(x, y *file) []problem { + p := eqResource(x.resource, y.resource) + + switch { + case x.content == nil: + p = append(p, existenceProblem("content", "expected content is nil")) + return p + case x.content == anyFileContent: + return p + case y.content == nil: + p = append(p, existenceProblem("content", "actual content is nil")) + return p + } + + xContent, xErr := ioutil.ReadAll(x.content) + defer x.content.Close() + yContent, yErr := ioutil.ReadAll(y.content) + defer y.content.Close() + + if xErr != nil { + p = append(p, errProblem("failed to read expected content", xErr)) + } + if yErr != nil { + p = append(p, errProblem("failed to read actual content", xErr)) + } + if xErr != nil || yErr != nil { + return p + } + + if !bytes.Equal(xContent, yContent) { + p = append(p, diffContent(xContent, yContent)) + } + return p +} + +func diffContent(x, y []byte) problem { + diff := format.UnifiedDiff(format.DiffConfig{ + A: string(x), + B: string(y), + From: "expected", + To: "actual", + }) + // Remove the trailing newline in the diff. A trailing newline is always + // added to a problem by formatFailures. + diff = strings.TrimSuffix(diff, "\n") + return problem("content:\n" + indent(diff, " ")) +} + +func indent(s, prefix string) string { + buf := new(bytes.Buffer) + lines := strings.SplitAfter(s, "\n") + for _, line := range lines { + buf.WriteString(prefix + line) + } + return buf.String() +} + +func eqSymlink(x, y *symlink) []problem { + p := eqResource(x.resource, y.resource) + if x.target != y.target { + p = append(p, notEqual("target", x.target, y.target)) + } + return p +} + +func eqDirectory(path string, x, y *directory) []failure { + p := eqResource(x.resource, y.resource) + var f []failure + + for _, name := range sortedKeys(x.items) { + if name == anyFile { + continue + } + xEntry := x.items[name] + yEntry, ok := y.items[name] + if !ok { + p = append(p, existenceProblem(name, "expected %s to exist", xEntry.Type())) + continue + } + + if xEntry.Type() != yEntry.Type() { + p = append(p, notEqual(name, xEntry.Type(), yEntry.Type())) + continue + } + + f = append(f, eqEntry(filepath.Join(path, name), xEntry, yEntry)...) + } + + if _, ok := x.items[anyFile]; !ok { + for _, name := range sortedKeys(y.items) { + if _, ok := x.items[name]; !ok { + yEntry := y.items[name] + p = append(p, existenceProblem(name, "unexpected %s", yEntry.Type())) + } + } + } + + if len(p) > 0 { + f = append(f, failure{path: path, problems: p}) + } + return f +} + +func sortedKeys(items map[string]dirEntry) []string { + var keys []string + for key := range items { + keys = append(keys, key) + } + sort.Strings(keys) + return keys +} + +// eqEntry assumes x and y to be the same type +func eqEntry(path string, x, y dirEntry) []failure { + resp := func(problems []problem) []failure { + if len(problems) == 0 { + return nil + } + return []failure{{path: path, problems: problems}} + } + + switch typed := x.(type) { + case *file: + return resp(eqFile(typed, y.(*file))) + case *symlink: + return resp(eqSymlink(typed, y.(*symlink))) + case *directory: + return eqDirectory(path, typed, y.(*directory)) + } + return nil +} + +func formatFailures(failures []failure) string { + sort.Slice(failures, func(i, j int) bool { + return failures[i].path < failures[j].path + }) + + buf := new(bytes.Buffer) + for _, failure := range failures { + buf.WriteString(failure.path + "\n") + for _, problem := range failure.problems { + buf.WriteString(" " + string(problem) + "\n") + } + } + return buf.String() +} diff --git a/vendor/github.com/gotestyourself/gotestyourself/icmd/command.go b/vendor/gotest.tools/icmd/command.go similarity index 98% rename from vendor/github.com/gotestyourself/gotestyourself/icmd/command.go rename to vendor/gotest.tools/icmd/command.go index 0066c51514ce98548203eac7d9cafa2cc2bea530..901895991a9567aba098a28c0884ef84de2747a3 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/icmd/command.go +++ b/vendor/gotest.tools/icmd/command.go @@ -1,6 +1,6 @@ /*Package icmd executes binaries and provides convenient assertions for testing the results. */ -package icmd +package icmd // import "gotest.tools/icmd" import ( "bytes" @@ -11,8 +11,8 @@ import ( "sync" "time" - "github.com/gotestyourself/gotestyourself/assert" - "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + "gotest.tools/assert/cmp" ) type helperT interface { @@ -228,6 +228,7 @@ func StartCmd(cmd Cmd) *Result { return result } +// TODO: support exec.CommandContext func buildCmd(cmd Cmd) *Result { var execCmd *exec.Cmd switch len(cmd.Command) { diff --git a/vendor/github.com/gotestyourself/gotestyourself/icmd/exitcode.go b/vendor/gotest.tools/icmd/exitcode.go similarity index 100% rename from vendor/github.com/gotestyourself/gotestyourself/icmd/exitcode.go rename to vendor/gotest.tools/icmd/exitcode.go diff --git a/vendor/github.com/gotestyourself/gotestyourself/icmd/ops.go b/vendor/gotest.tools/icmd/ops.go similarity index 100% rename from vendor/github.com/gotestyourself/gotestyourself/icmd/ops.go rename to vendor/gotest.tools/icmd/ops.go diff --git a/vendor/github.com/pmezard/go-difflib/LICENSE b/vendor/gotest.tools/internal/difflib/LICENSE similarity index 100% rename from vendor/github.com/pmezard/go-difflib/LICENSE rename to vendor/gotest.tools/internal/difflib/LICENSE diff --git a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/gotest.tools/internal/difflib/difflib.go similarity index 56% rename from vendor/github.com/pmezard/go-difflib/difflib/difflib.go rename to vendor/gotest.tools/internal/difflib/difflib.go index 003e99fadb4f189565b409b9509ecf30b752d25a..5efa99c1d4615452067f034c81ab40686c6e76d5 100644 --- a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go +++ b/vendor/gotest.tools/internal/difflib/difflib.go @@ -1,27 +1,10 @@ -// Package difflib is a partial port of Python difflib module. -// -// It provides tools to compare sequences of strings and generate textual diffs. -// -// The following class and functions have been ported: -// -// - SequenceMatcher -// -// - unified_diff -// -// - context_diff -// -// Getting unified diffs was the main goal of the port. Keep in mind this code -// is mostly suitable to output text differences in a human friendly way, there -// are no guarantees generated diffs are consumable by patch(1). -package difflib +/* Package difflib is a partial port of Python difflib module. + +Original source: https://github.com/pmezard/go-difflib -import ( - "bufio" - "bytes" - "fmt" - "io" - "strings" -) +This file is trimmed to only the parts used by this repository. +*/ +package difflib // import "gotest.tools/internal/difflib" func min(a, b int) int { if a < b { @@ -37,13 +20,6 @@ func max(a, b int) int { return b } -func calculateRatio(matches, length int) float64 { - if length > 0 { - return 2.0 * float64(matches) / float64(length) - } - return 1.0 -} - type Match struct { A int B int @@ -103,14 +79,6 @@ func NewMatcher(a, b []string) *SequenceMatcher { return &m } -func NewMatcherWithJunk(a, b []string, autoJunk bool, - isJunk func(string) bool) *SequenceMatcher { - - m := SequenceMatcher{IsJunk: isJunk, autoJunk: autoJunk} - m.SetSeqs(a, b) - return &m -} - // Set two sequences to be compared. func (m *SequenceMatcher) SetSeqs(a, b []string) { m.SetSeq1(a) @@ -450,323 +418,3 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode { } return groups } - -// Return a measure of the sequences' similarity (float in [0,1]). -// -// Where T is the total number of elements in both sequences, and -// M is the number of matches, this is 2.0*M / T. -// Note that this is 1 if the sequences are identical, and 0 if -// they have nothing in common. -// -// .Ratio() is expensive to compute if you haven't already computed -// .GetMatchingBlocks() or .GetOpCodes(), in which case you may -// want to try .QuickRatio() or .RealQuickRation() first to get an -// upper bound. -func (m *SequenceMatcher) Ratio() float64 { - matches := 0 - for _, m := range m.GetMatchingBlocks() { - matches += m.Size - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() relatively quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute. -func (m *SequenceMatcher) QuickRatio() float64 { - // viewing a and b as multisets, set matches to the cardinality - // of their intersection; this counts the number of matches - // without regard to order, so is clearly an upper bound - if m.fullBCount == nil { - m.fullBCount = map[string]int{} - for _, s := range m.b { - m.fullBCount[s] = m.fullBCount[s] + 1 - } - } - - // avail[x] is the number of times x appears in 'b' less the - // number of times we've seen it in 'a' so far ... kinda - avail := map[string]int{} - matches := 0 - for _, s := range m.a { - n, ok := avail[s] - if !ok { - n = m.fullBCount[s] - } - avail[s] = n - 1 - if n > 0 { - matches += 1 - } - } - return calculateRatio(matches, len(m.a)+len(m.b)) -} - -// Return an upper bound on ratio() very quickly. -// -// This isn't defined beyond that it is an upper bound on .Ratio(), and -// is faster to compute than either .Ratio() or .QuickRatio(). -func (m *SequenceMatcher) RealQuickRatio() float64 { - la, lb := len(m.a), len(m.b) - return calculateRatio(min(la, lb), la+lb) -} - -// Convert range to the "ed" format -func formatRangeUnified(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 1 { - return fmt.Sprintf("%d", beginning) - } - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - return fmt.Sprintf("%d,%d", beginning, length) -} - -// Unified diff parameters -type UnifiedDiff struct { - A []string // First sequence lines - FromFile string // First file name - FromDate string // First file time - B []string // Second sequence lines - ToFile string // Second file name - ToDate string // Second file time - Eol string // Headers end of line, defaults to LF - Context int // Number of context lines -} - -// Compare two sequences of lines; generate the delta as a unified diff. -// -// Unified diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by 'n' which -// defaults to three. -// -// By default, the diff control lines (those with ---, +++, or @@) are -// created with a trailing newline. This is helpful so that inputs -// created from file.readlines() result in diffs that are suitable for -// file.writelines() since both the inputs and outputs have trailing -// newlines. -// -// For inputs that do not have trailing newlines, set the lineterm -// argument to "" so that the output will be uniformly newline free. -// -// The unidiff format normally has a header for filenames and modification -// times. Any or all of these may be specified using strings for -// 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'. -// The modification times are normally expressed in the ISO 8601 format. -func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - wf := func(format string, args ...interface{}) error { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - return err - } - ws := func(s string) error { - _, err := buf.WriteString(s) - return err - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - if diff.FromFile != "" || diff.ToFile != "" { - err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) - if err != nil { - return err - } - err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) - if err != nil { - return err - } - } - } - first, last := g[0], g[len(g)-1] - range1 := formatRangeUnified(first.I1, last.I2) - range2 := formatRangeUnified(first.J1, last.J2) - if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { - return err - } - for _, c := range g { - i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 - if c.Tag == 'e' { - for _, line := range diff.A[i1:i2] { - if err := ws(" " + line); err != nil { - return err - } - } - continue - } - if c.Tag == 'r' || c.Tag == 'd' { - for _, line := range diff.A[i1:i2] { - if err := ws("-" + line); err != nil { - return err - } - } - } - if c.Tag == 'r' || c.Tag == 'i' { - for _, line := range diff.B[j1:j2] { - if err := ws("+" + line); err != nil { - return err - } - } - } - } - } - return nil -} - -// Like WriteUnifiedDiff but returns the diff a string. -func GetUnifiedDiffString(diff UnifiedDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteUnifiedDiff(w, diff) - return string(w.Bytes()), err -} - -// Convert range to the "ed" format. -func formatRangeContext(start, stop int) string { - // Per the diff spec at http://www.unix.org/single_unix_specification/ - beginning := start + 1 // lines start numbering with one - length := stop - start - if length == 0 { - beginning -= 1 // empty ranges begin at line just before the range - } - if length <= 1 { - return fmt.Sprintf("%d", beginning) - } - return fmt.Sprintf("%d,%d", beginning, beginning+length-1) -} - -type ContextDiff UnifiedDiff - -// Compare two sequences of lines; generate the delta as a context diff. -// -// Context diffs are a compact way of showing line changes and a few -// lines of context. The number of context lines is set by diff.Context -// which defaults to three. -// -// By default, the diff control lines (those with *** or ---) are -// created with a trailing newline. -// -// For inputs that do not have trailing newlines, set the diff.Eol -// argument to "" so that the output will be uniformly newline free. -// -// The context diff format normally has a header for filenames and -// modification times. Any or all of these may be specified using -// strings for diff.FromFile, diff.ToFile, diff.FromDate, diff.ToDate. -// The modification times are normally expressed in the ISO 8601 format. -// If not specified, the strings default to blanks. -func WriteContextDiff(writer io.Writer, diff ContextDiff) error { - buf := bufio.NewWriter(writer) - defer buf.Flush() - var diffErr error - wf := func(format string, args ...interface{}) { - _, err := buf.WriteString(fmt.Sprintf(format, args...)) - if diffErr == nil && err != nil { - diffErr = err - } - } - ws := func(s string) { - _, err := buf.WriteString(s) - if diffErr == nil && err != nil { - diffErr = err - } - } - - if len(diff.Eol) == 0 { - diff.Eol = "\n" - } - - prefix := map[byte]string{ - 'i': "+ ", - 'd': "- ", - 'r': "! ", - 'e': " ", - } - - started := false - m := NewMatcher(diff.A, diff.B) - for _, g := range m.GetGroupedOpCodes(diff.Context) { - if !started { - started = true - fromDate := "" - if len(diff.FromDate) > 0 { - fromDate = "\t" + diff.FromDate - } - toDate := "" - if len(diff.ToDate) > 0 { - toDate = "\t" + diff.ToDate - } - if diff.FromFile != "" || diff.ToFile != "" { - wf("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) - wf("--- %s%s%s", diff.ToFile, toDate, diff.Eol) - } - } - - first, last := g[0], g[len(g)-1] - ws("***************" + diff.Eol) - - range1 := formatRangeContext(first.I1, last.I2) - wf("*** %s ****%s", range1, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'd' { - for _, cc := range g { - if cc.Tag == 'i' { - continue - } - for _, line := range diff.A[cc.I1:cc.I2] { - ws(prefix[cc.Tag] + line) - } - } - break - } - } - - range2 := formatRangeContext(first.J1, last.J2) - wf("--- %s ----%s", range2, diff.Eol) - for _, c := range g { - if c.Tag == 'r' || c.Tag == 'i' { - for _, cc := range g { - if cc.Tag == 'd' { - continue - } - for _, line := range diff.B[cc.J1:cc.J2] { - ws(prefix[cc.Tag] + line) - } - } - break - } - } - } - return diffErr -} - -// Like WriteContextDiff but returns the diff a string. -func GetContextDiffString(diff ContextDiff) (string, error) { - w := &bytes.Buffer{} - err := WriteContextDiff(w, diff) - return string(w.Bytes()), err -} - -// Split a string on "\n" while preserving them. The output can be used -// as input for UnifiedDiff and ContextDiff structures. -func SplitLines(s string) []string { - lines := strings.SplitAfter(s, "\n") - lines[len(lines)-1] += "\n" - return lines -} diff --git a/vendor/gotest.tools/internal/format/diff.go b/vendor/gotest.tools/internal/format/diff.go new file mode 100644 index 0000000000000000000000000000000000000000..c938c97bec147c1e6532117a8254cc51ab813944 --- /dev/null +++ b/vendor/gotest.tools/internal/format/diff.go @@ -0,0 +1,161 @@ +package format + +import ( + "bytes" + "fmt" + "strings" + "unicode" + + "gotest.tools/internal/difflib" +) + +const ( + contextLines = 2 +) + +// DiffConfig for a unified diff +type DiffConfig struct { + A string + B string + From string + To string +} + +// UnifiedDiff is a modified version of difflib.WriteUnifiedDiff with better +// support for showing the whitespace differences. +func UnifiedDiff(conf DiffConfig) string { + a := strings.SplitAfter(conf.A, "\n") + b := strings.SplitAfter(conf.B, "\n") + groups := difflib.NewMatcher(a, b).GetGroupedOpCodes(contextLines) + if len(groups) == 0 { + return "" + } + + buf := new(bytes.Buffer) + writeFormat := func(format string, args ...interface{}) { + buf.WriteString(fmt.Sprintf(format, args...)) + } + writeLine := func(prefix string, s string) { + buf.WriteString(prefix + s) + } + if hasWhitespaceDiffLines(groups, a, b) { + writeLine = visibleWhitespaceLine(writeLine) + } + formatHeader(writeFormat, conf) + for _, group := range groups { + formatRangeLine(writeFormat, group) + for _, opCode := range group { + in, out := a[opCode.I1:opCode.I2], b[opCode.J1:opCode.J2] + switch opCode.Tag { + case 'e': + formatLines(writeLine, " ", in) + case 'r': + formatLines(writeLine, "-", in) + formatLines(writeLine, "+", out) + case 'd': + formatLines(writeLine, "-", in) + case 'i': + formatLines(writeLine, "+", out) + } + } + } + return buf.String() +} + +// hasWhitespaceDiffLines returns true if any diff groups is only different +// because of whitespace characters. +func hasWhitespaceDiffLines(groups [][]difflib.OpCode, a, b []string) bool { + for _, group := range groups { + in, out := new(bytes.Buffer), new(bytes.Buffer) + for _, opCode := range group { + if opCode.Tag == 'e' { + continue + } + for _, line := range a[opCode.I1:opCode.I2] { + in.WriteString(line) + } + for _, line := range b[opCode.J1:opCode.J2] { + out.WriteString(line) + } + } + if removeWhitespace(in.String()) == removeWhitespace(out.String()) { + return true + } + } + return false +} + +func removeWhitespace(s string) string { + var result []rune + for _, r := range s { + if !unicode.IsSpace(r) { + result = append(result, r) + } + } + return string(result) +} + +func visibleWhitespaceLine(ws func(string, string)) func(string, string) { + mapToVisibleSpace := func(r rune) rune { + switch r { + case '\n': + case ' ': + return '·' + case '\t': + return '▷' + case '\v': + return '▽' + case '\r': + return '↵' + case '\f': + return '↓' + default: + if unicode.IsSpace(r) { + return '�' + } + } + return r + } + return func(prefix, s string) { + ws(prefix, strings.Map(mapToVisibleSpace, s)) + } +} + +func formatHeader(wf func(string, ...interface{}), conf DiffConfig) { + if conf.From != "" || conf.To != "" { + wf("--- %s\n", conf.From) + wf("+++ %s\n", conf.To) + } +} + +func formatRangeLine(wf func(string, ...interface{}), group []difflib.OpCode) { + first, last := group[0], group[len(group)-1] + range1 := formatRangeUnified(first.I1, last.I2) + range2 := formatRangeUnified(first.J1, last.J2) + wf("@@ -%s +%s @@\n", range1, range2) +} + +// Convert range to the "ed" format +func formatRangeUnified(start, stop int) string { + // Per the diff spec at http://www.unix.org/single_unix_specification/ + beginning := start + 1 // lines start numbering with one + length := stop - start + if length == 1 { + return fmt.Sprintf("%d", beginning) + } + if length == 0 { + beginning-- // empty ranges begin at line just before the range + } + return fmt.Sprintf("%d,%d", beginning, length) +} + +func formatLines(writeLine func(string, string), prefix string, lines []string) { + for _, line := range lines { + writeLine(prefix, line) + } + // Add a newline if the last line is missing one so that the diff displays + // properly. + if !strings.HasSuffix(lines[len(lines)-1], "\n") { + writeLine("", "\n") + } +} diff --git a/vendor/github.com/gotestyourself/gotestyourself/internal/format/format.go b/vendor/gotest.tools/internal/format/format.go similarity index 91% rename from vendor/github.com/gotestyourself/gotestyourself/internal/format/format.go rename to vendor/gotest.tools/internal/format/format.go index 6961ffe6da6a804489243c75097cefb06b73dbdb..8f6494f99421d5565b910bacb2c6f16005b72de6 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/internal/format/format.go +++ b/vendor/gotest.tools/internal/format/format.go @@ -1,4 +1,4 @@ -package format +package format // import "gotest.tools/internal/format" import "fmt" diff --git a/vendor/github.com/gotestyourself/gotestyourself/internal/source/source.go b/vendor/gotest.tools/internal/source/source.go similarity index 98% rename from vendor/github.com/gotestyourself/gotestyourself/internal/source/source.go rename to vendor/gotest.tools/internal/source/source.go index f71c5129b87622ef703ee20b69b8d940e0c5c873..a05933cc3380e23dc607d4b4f7a935edb50506ec 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/internal/source/source.go +++ b/vendor/gotest.tools/internal/source/source.go @@ -1,4 +1,4 @@ -package source +package source // import "gotest.tools/internal/source" import ( "bytes" diff --git a/vendor/github.com/gotestyourself/gotestyourself/poll/poll.go b/vendor/gotest.tools/poll/poll.go similarity index 95% rename from vendor/github.com/gotestyourself/gotestyourself/poll/poll.go rename to vendor/gotest.tools/poll/poll.go index 42a42cc14943a855ddf5365d9d41f9b5ce6cf7fd..3e3dd7f58a37d1d60fcc9f4edc6a5b7d0d2f92b7 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/poll/poll.go +++ b/vendor/gotest.tools/poll/poll.go @@ -1,6 +1,6 @@ /*Package poll provides tools for testing asynchronous code. */ -package poll +package poll // import "gotest.tools/poll" import ( "fmt" @@ -25,15 +25,15 @@ type helperT interface { // Settings are used to configure the behaviour of WaitOn type Settings struct { - // Timeout is the maximum time to wait for the condition. Defaults to 10s + // Timeout is the maximum time to wait for the condition. Defaults to 10s. Timeout time.Duration - // Delay is the time to sleep between checking the condition. Detaults to - // 1ms + // Delay is the time to sleep between checking the condition. Defaults to + // 100ms. Delay time.Duration } func defaultConfig() *Settings { - return &Settings{Timeout: 10 * time.Second, Delay: time.Millisecond} + return &Settings{Timeout: 10 * time.Second, Delay: 100 * time.Millisecond} } // SettingOp is a function which accepts and modifies Settings diff --git a/vendor/github.com/gotestyourself/gotestyourself/skip/skip.go b/vendor/gotest.tools/skip/skip.go similarity index 60% rename from vendor/github.com/gotestyourself/gotestyourself/skip/skip.go rename to vendor/gotest.tools/skip/skip.go index 46ab288819bff72410cc3374341b738ee21d0b58..4bfc9a11c2da125477b97e06e9cedb03ed45f4f9 100644 --- a/vendor/github.com/gotestyourself/gotestyourself/skip/skip.go +++ b/vendor/gotest.tools/skip/skip.go @@ -1,6 +1,7 @@ -/*Package skip provides functions for skipping based on a condition. - */ -package skip +/*Package skip provides functions for skipping a test and printing the source code +of the condition used to skip the test. +*/ +package skip // import "gotest.tools/skip" import ( "fmt" @@ -9,8 +10,8 @@ import ( "runtime" "strings" - "github.com/gotestyourself/gotestyourself/internal/format" - "github.com/gotestyourself/gotestyourself/internal/source" + "gotest.tools/internal/format" + "gotest.tools/internal/source" ) type skipT interface { @@ -25,9 +26,10 @@ type helperT interface { // BoolOrCheckFunc can be a bool or func() bool, other types will panic type BoolOrCheckFunc interface{} -// If skips the test if the check function returns true. The skip message will -// contain the name of the check function. Extra message text can be passed as a -// format string with args +// If the condition expression evaluates to true, or the condition function returns +// true, skip the test. +// The skip message will contain the source code of the expression. +// Extra message text can be passed as a format string with args func If(t skipT, condition BoolOrCheckFunc, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() @@ -49,18 +51,6 @@ func getFunctionName(function func() bool) string { return strings.SplitN(path.Base(funcPath), ".", 2)[1] } -// IfCondition skips the test if the condition is true. The skip message will -// contain the source of the expression passed as the condition. Extra message -// text can be passed as a format string with args. -// -// Deprecated: Use If() which now accepts bool arguments -func IfCondition(t skipT, condition bool, msgAndArgs ...interface{}) { - if ht, ok := t.(helperT); ok { - ht.Helper() - } - ifCondition(t, condition, msgAndArgs...) -} - func ifCondition(t skipT, condition bool, msgAndArgs ...interface{}) { if ht, ok := t.(helperT); ok { ht.Helper() diff --git a/vendor/gotest.tools/x/subtest/context.go b/vendor/gotest.tools/x/subtest/context.go new file mode 100644 index 0000000000000000000000000000000000000000..878bdebf14d89a3f9d26731beef21e99064d7021 --- /dev/null +++ b/vendor/gotest.tools/x/subtest/context.go @@ -0,0 +1,81 @@ +/*Package subtest provides a TestContext to subtests which handles cleanup, and +provides a testing.TB, and context.Context. + +This package was inspired by github.com/frankban/quicktest. +*/ +package subtest // import "gotest.tools/x/subtest" + +import ( + "context" + "testing" +) + +type testcase struct { + testing.TB + ctx context.Context + cleanupFuncs []cleanupFunc +} + +type cleanupFunc func() + +func (tc *testcase) Ctx() context.Context { + if tc.ctx == nil { + var cancel func() + tc.ctx, cancel = context.WithCancel(context.Background()) + tc.AddCleanup(cancel) + } + return tc.ctx +} + +// Cleanup runs all cleanup functions. Functions are run in the opposite order +// in which they were added. Cleanup is called automatically before Run exits. +func (tc *testcase) Cleanup() { + for _, f := range tc.cleanupFuncs { + // Defer all cleanup functions so they all run even if one calls + // t.FailNow() or panics. Deferring them also runs them in reverse order. + defer f() + } + tc.cleanupFuncs = nil +} + +func (tc *testcase) AddCleanup(f func()) { + tc.cleanupFuncs = append(tc.cleanupFuncs, f) +} + +func (tc *testcase) Parallel() { + tp, ok := tc.TB.(parallel) + if !ok { + panic("Parallel called with a testing.B") + } + tp.Parallel() +} + +type parallel interface { + Parallel() +} + +// Run a subtest. When subtest exits, every cleanup function added with +// TestContext.AddCleanup will be run. +func Run(t *testing.T, name string, subtest func(t TestContext)) bool { + return t.Run(name, func(t *testing.T) { + tc := &testcase{TB: t} + defer tc.Cleanup() + subtest(tc) + }) +} + +// TestContext provides a testing.TB and a context.Context for a test case. +type TestContext interface { + testing.TB + // AddCleanup function which will be run when before Run returns. + AddCleanup(f func()) + // Ctx returns a context for the test case. Multiple calls from the same subtest + // will return the same context. The context is cancelled when Run + // returns. + Ctx() context.Context + // Parallel calls t.Parallel on the testing.TB. Panics if testing.TB does + // not implement Parallel. + Parallel() +} + +var _ TestContext = &testcase{} diff --git a/volume/local/local_test.go b/volume/local/local_test.go index 541b8448aa0abf56d59af295714db37bbdb69023..4cb47ba04522951f133fd101e89a47b94c7324bf 100644 --- a/volume/local/local_test.go +++ b/volume/local/local_test.go @@ -11,7 +11,7 @@ import ( "github.com/docker/docker/pkg/idtools" "github.com/docker/docker/pkg/mount" - "github.com/gotestyourself/gotestyourself/skip" + "gotest.tools/skip" ) func TestGetAddress(t *testing.T) { diff --git a/volume/service/db_test.go b/volume/service/db_test.go index 14ad87a514c3fe58d0ecf6e83a0264d3d97af1fd..4cac9176b75d0c3a4c9ff8d4f923789511e54af4 100644 --- a/volume/service/db_test.go +++ b/volume/service/db_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/boltdb/bolt" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestSetGetMeta(t *testing.T) { diff --git a/volume/service/restore_test.go b/volume/service/restore_test.go index d3c6c9f92ced14d83ceab79f3defecb14b690bea..95420d9586a55e83ade4a2c67a1d5dccf3c6e035 100644 --- a/volume/service/restore_test.go +++ b/volume/service/restore_test.go @@ -10,7 +10,7 @@ import ( volumedrivers "github.com/docker/docker/volume/drivers" "github.com/docker/docker/volume/service/opts" volumetestutils "github.com/docker/docker/volume/testutils" - "github.com/gotestyourself/gotestyourself/assert" + "gotest.tools/assert" ) func TestRestore(t *testing.T) { diff --git a/volume/service/service_linux_test.go b/volume/service/service_linux_test.go index 6c1f936b6abf8fa06f25c804a9a91253ceda9f7c..ae70d7e2c5f99700689d3c175a2ec3d61cffb7da 100644 --- a/volume/service/service_linux_test.go +++ b/volume/service/service_linux_test.go @@ -13,8 +13,8 @@ import ( "github.com/docker/docker/volume/local" "github.com/docker/docker/volume/service/opts" "github.com/docker/docker/volume/testutils" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestLocalVolumeSize(t *testing.T) { diff --git a/volume/service/service_test.go b/volume/service/service_test.go index 3c4130eab5677ff6aa115e21d8bc62ad65b7325e..870d19f8a0abebd840de58e72dceae20fe72aad9 100644 --- a/volume/service/service_test.go +++ b/volume/service/service_test.go @@ -12,8 +12,8 @@ import ( volumedrivers "github.com/docker/docker/volume/drivers" "github.com/docker/docker/volume/service/opts" "github.com/docker/docker/volume/testutils" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestServiceCreate(t *testing.T) { diff --git a/volume/service/store_test.go b/volume/service/store_test.go index b6b08299522230900b957634f40e692c07d322b4..53345f318bb51604975dfa09ae9144f833178db0 100644 --- a/volume/service/store_test.go +++ b/volume/service/store_test.go @@ -15,8 +15,8 @@ import ( "github.com/docker/docker/volume/service/opts" volumetestutils "github.com/docker/docker/volume/testutils" "github.com/google/go-cmp/cmp" - "github.com/gotestyourself/gotestyourself/assert" - is "github.com/gotestyourself/gotestyourself/assert/cmp" + "gotest.tools/assert" + is "gotest.tools/assert/cmp" ) func TestCreate(t *testing.T) {