mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	vendor: gotest.tools/v3 v3.1.0
full diff: https://github.com/gotestyourself/gotest.tools/compare/v3.0.3...v3.1.0 noteworthy changes: - ci: add go1.16 - ci: add go1.17, remove go1.13 - golden: only create dir if update flag is set - icmd: replace all usages of os/exec with golang.org/x/sys/execabs - assert: ErrorIs - fs: add DirFromPath - Stop creating directory outside of testdata - fs: Fix comparing symlink permissions Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
		
							parent
							
								
									c35143f92e
								
							
						
					
					
						commit
						89d39e5e77
					
				
					 10 changed files with 101 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -83,7 +83,7 @@ require (
 | 
			
		|||
	golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11
 | 
			
		||||
	google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
 | 
			
		||||
	google.golang.org/grpc v1.40.0
 | 
			
		||||
	gotest.tools/v3 v3.0.3
 | 
			
		||||
	gotest.tools/v3 v3.1.0
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
require (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -918,6 +918,7 @@ golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7w
 | 
			
		|||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20210313202042-bd2e13477e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
			
		||||
| 
						 | 
				
			
			@ -979,6 +980,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY
 | 
			
		|||
golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
			
		||||
golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
 | 
			
		||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
			
		||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
 | 
			
		||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 | 
			
		||||
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
 | 
			
		||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
 | 
			
		||||
| 
						 | 
				
			
			@ -1036,8 +1038,9 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie
 | 
			
		|||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
			
		||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
 | 
			
		||||
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
 | 
			
		||||
gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0=
 | 
			
		||||
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
 | 
			
		||||
gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk=
 | 
			
		||||
gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ=
 | 
			
		||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
			
		||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
			
		||||
k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo=
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										20
									
								
								vendor/gotest.tools/v3/assert/assert_go113.go
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								vendor/gotest.tools/v3/assert/assert_go113.go
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
// +build go1.13
 | 
			
		||||
 | 
			
		||||
package assert
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"gotest.tools/v3/assert/cmp"
 | 
			
		||||
	"gotest.tools/v3/internal/assert"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ErrorIs fails the test if err is nil, or the error does not match expected
 | 
			
		||||
// when compared using errors.Is. See https://golang.org/pkg/errors/#Is for
 | 
			
		||||
// accepted argument values.
 | 
			
		||||
func ErrorIs(t TestingT, err error, expected error, msgAndArgs ...interface{}) {
 | 
			
		||||
	if ht, ok := t.(helperT); ok {
 | 
			
		||||
		ht.Helper()
 | 
			
		||||
	}
 | 
			
		||||
	if !assert.Eval(t, assert.ArgsAfterT, cmp.ErrorIs(err, expected), msgAndArgs...) {
 | 
			
		||||
		t.FailNow()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								vendor/gotest.tools/v3/assert/cmp/compare_go113.go
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/gotest.tools/v3/assert/cmp/compare_go113.go
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
// +build go1.13
 | 
			
		||||
 | 
			
		||||
package cmp
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ErrorIs succeeds if errors.Is(actual, expected) returns true. See
 | 
			
		||||
// https://golang.org/pkg/errors/#Is for accepted argument values.
 | 
			
		||||
func ErrorIs(actual error, expected error) Comparison {
 | 
			
		||||
	return func() Result {
 | 
			
		||||
		if errors.Is(actual, expected) {
 | 
			
		||||
			return ResultSuccess
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return ResultFailureTemplate(`error is
 | 
			
		||||
			{{- if not .Data.a }} nil,{{ else }}
 | 
			
		||||
			{{- printf " \"%v\"" .Data.a}} (
 | 
			
		||||
				{{- with callArg 0 }}{{ formatNode . }} {{end -}}
 | 
			
		||||
				{{- printf "%T" .Data.a -}}
 | 
			
		||||
			),
 | 
			
		||||
			{{- end }} not {{ printf "\"%v\"" .Data.x}} (
 | 
			
		||||
				{{- with callArg 1 }}{{ formatNode . }} {{end -}}
 | 
			
		||||
				{{- printf "%T" .Data.x -}}
 | 
			
		||||
			)`,
 | 
			
		||||
			map[string]interface{}{"a": actual, "x": expected})
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										16
									
								
								vendor/gotest.tools/v3/fs/file.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/gotest.tools/v3/fs/file.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -113,3 +113,19 @@ func (d *Dir) Remove() {
 | 
			
		|||
func (d *Dir) Join(parts ...string) string {
 | 
			
		||||
	return filepath.Join(append([]string{d.Path()}, parts...)...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DirFromPath returns a Dir for a path that already exists. No directory is created.
 | 
			
		||||
// Unlike NewDir the directory will not be removed automatically when the test exits,
 | 
			
		||||
// it is the callers responsibly to remove the directory.
 | 
			
		||||
// DirFromPath can be used with Apply to modify an existing directory.
 | 
			
		||||
//
 | 
			
		||||
// If the path does not already exist, use NewDir instead.
 | 
			
		||||
func DirFromPath(t assert.TestingT, path string, ops ...PathOp) *Dir {
 | 
			
		||||
	if ht, ok := t.(helperT); ok {
 | 
			
		||||
		ht.Helper()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dir := &Dir{path: path}
 | 
			
		||||
	assert.NilError(t, applyPathOps(dir, ops))
 | 
			
		||||
	return dir
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										16
									
								
								vendor/gotest.tools/v3/fs/manifest_unix.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/gotest.tools/v3/fs/manifest_unix.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,16 +1,24 @@
 | 
			
		|||
//go:build !windows
 | 
			
		||||
// +build !windows
 | 
			
		||||
 | 
			
		||||
package fs
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"syscall"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	defaultRootDirMode = os.ModeDir | 0700
 | 
			
		||||
	defaultSymlinkMode = os.ModeSymlink | 0777
 | 
			
		||||
)
 | 
			
		||||
const defaultRootDirMode = os.ModeDir | 0700
 | 
			
		||||
 | 
			
		||||
var defaultSymlinkMode = os.ModeSymlink | 0777
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	switch runtime.GOOS {
 | 
			
		||||
	case "darwin":
 | 
			
		||||
		defaultSymlinkMode = os.ModeSymlink | 0755
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func newResourceFromInfo(info os.FileInfo) resource {
 | 
			
		||||
	statT := info.Sys().(*syscall.Stat_t)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								vendor/gotest.tools/v3/icmd/command.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/gotest.tools/v3/icmd/command.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -7,11 +7,11 @@ import (
 | 
			
		|||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"os"
 | 
			
		||||
	"os/exec"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	exec "golang.org/x/sys/execabs"
 | 
			
		||||
	"gotest.tools/v3/assert"
 | 
			
		||||
	"gotest.tools/v3/assert/cmp"
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								vendor/gotest.tools/v3/icmd/exitcode.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/gotest.tools/v3/icmd/exitcode.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -1,10 +1,10 @@
 | 
			
		|||
package icmd
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"os/exec"
 | 
			
		||||
	"syscall"
 | 
			
		||||
 | 
			
		||||
	"github.com/pkg/errors"
 | 
			
		||||
	exec "golang.org/x/sys/execabs"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// getExitCode returns the ExitStatus of a process from the error returned by
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										24
									
								
								vendor/gotest.tools/v3/poll/check.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/gotest.tools/v3/poll/check.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -11,16 +11,20 @@ type Check func(t LogT) Result
 | 
			
		|||
// FileExists looks on filesystem and check that path exists.
 | 
			
		||||
func FileExists(path string) Check {
 | 
			
		||||
	return func(t LogT) Result {
 | 
			
		||||
		_, err := os.Stat(path)
 | 
			
		||||
		if os.IsNotExist(err) {
 | 
			
		||||
			t.Logf("waiting on file %s to exist", path)
 | 
			
		||||
			return Continue("file %s does not exist", path)
 | 
			
		||||
		}
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return Error(err)
 | 
			
		||||
		if h, ok := t.(helperT); ok {
 | 
			
		||||
			h.Helper()
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return Success()
 | 
			
		||||
		_, err := os.Stat(path)
 | 
			
		||||
		switch {
 | 
			
		||||
		case os.IsNotExist(err):
 | 
			
		||||
			t.Logf("waiting on file %s to exist", path)
 | 
			
		||||
			return Continue("file %s does not exist", path)
 | 
			
		||||
		case err != nil:
 | 
			
		||||
			return Error(err)
 | 
			
		||||
		default:
 | 
			
		||||
			return Success()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -29,6 +33,10 @@ func FileExists(path string) Check {
 | 
			
		|||
// address parameters.
 | 
			
		||||
func Connection(network, address string) Check {
 | 
			
		||||
	return func(t LogT) Result {
 | 
			
		||||
		if h, ok := t.(helperT); ok {
 | 
			
		||||
			h.Helper()
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		_, err := net.Dial(network, address)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			t.Logf("waiting on socket %s://%s to be available...", network, address)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								vendor/modules.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/modules.txt
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -972,7 +972,7 @@ google.golang.org/grpc/serviceconfig
 | 
			
		|||
google.golang.org/grpc/stats
 | 
			
		||||
google.golang.org/grpc/status
 | 
			
		||||
google.golang.org/grpc/tap
 | 
			
		||||
# gotest.tools/v3 v3.0.3
 | 
			
		||||
# gotest.tools/v3 v3.1.0
 | 
			
		||||
## explicit; go 1.11
 | 
			
		||||
gotest.tools/v3/assert
 | 
			
		||||
gotest.tools/v3/assert/cmp
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue