Bladeren bron

testutil: remove unneeded namer, testname interfaces

Now that the gocheck framework is no longer used, we don't
have to define these interfaces.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 5 jaren geleden
bovenliggende
commit
3e4f6225da

+ 1 - 0
integration-cli/cli/build/build.go

@@ -11,6 +11,7 @@ import (
 type testingT interface {
 type testingT interface {
 	Fatal(args ...interface{})
 	Fatal(args ...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 // WithStdinContext sets the build context from the standard input with the specified reader
 // WithStdinContext sets the build context from the standard input with the specified reader

+ 1 - 0
integration-cli/cli/cli.go

@@ -28,6 +28,7 @@ type testingT interface {
 	assert.TestingT
 	assert.TestingT
 	Fatal(args ...interface{})
 	Fatal(args ...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 // DockerCmd executes the specified docker command and expect a success
 // DockerCmd executes the specified docker command and expect a success

+ 1 - 0
integration-cli/daemon/daemon.go

@@ -16,6 +16,7 @@ type testingT interface {
 	assert.TestingT
 	assert.TestingT
 	logT
 	logT
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 type logT interface {
 type logT interface {

+ 1 - 12
testutil/daemon/daemon.go

@@ -32,14 +32,8 @@ type testingT interface {
 	assert.TestingT
 	assert.TestingT
 	logT
 	logT
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
-}
-
-type namer interface {
 	Name() string
 	Name() string
 }
 }
-type testNamer interface {
-	TestName() string
-}
 
 
 type logT interface {
 type logT interface {
 	Logf(string, ...interface{})
 	Logf(string, ...interface{})
@@ -157,13 +151,8 @@ func New(t testingT, ops ...Option) *Daemon {
 	if dest == "" {
 	if dest == "" {
 		dest = os.Getenv("DEST")
 		dest = os.Getenv("DEST")
 	}
 	}
+	dest = filepath.Join(dest, t.Name())
 
 
-	switch v := t.(type) {
-	case namer:
-		dest = filepath.Join(dest, v.Name())
-	case testNamer:
-		dest = filepath.Join(dest, v.TestName())
-	}
 	assert.Check(t, dest != "", "Please set the DOCKER_INTEGRATION_DAEMON_DEST or the DEST environment variable")
 	assert.Check(t, dest != "", "Please set the DOCKER_INTEGRATION_DAEMON_DEST or the DEST environment variable")
 
 
 	t.Logf("Creating a new daemon at: %q", dest)
 	t.Logf("Creating a new daemon at: %q", dest)

+ 1 - 0
testutil/fakecontext/context.go

@@ -14,6 +14,7 @@ import (
 type testingT interface {
 type testingT interface {
 	Fatal(args ...interface{})
 	Fatal(args ...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 // New creates a fake build context
 // New creates a fake build context

+ 1 - 0
testutil/fakegit/fakegit.go

@@ -21,6 +21,7 @@ type testingT interface {
 	skipT
 	skipT
 	Fatal(args ...interface{})
 	Fatal(args ...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 type logT interface {
 type logT interface {

+ 1 - 0
testutil/fakestorage/storage.go

@@ -30,6 +30,7 @@ type testingT interface {
 	skipT
 	skipT
 	Fatal(args ...interface{})
 	Fatal(args ...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 type logT interface {
 type logT interface {

+ 1 - 0
testutil/registry/registry.go

@@ -28,6 +28,7 @@ type testingT interface {
 	logT
 	logT
 	Fatal(...interface{})
 	Fatal(...interface{})
 	Fatalf(string, ...interface{})
 	Fatalf(string, ...interface{})
+	Name() string
 }
 }
 
 
 type logT interface {
 type logT interface {