integration: organize bundle directory per test
The test-integration/test=integration-cli directory contains a directory for each daemon that was created during the integration tests, which makes it a long list to browse through. In addition, some tests spin up multiple daemons, and when debugging test-failures, the daemon-logs often have to be looked at together. This patch organizes the bundl directory to group daemon storage locationos per test, making it easier to find information about all the daemons that were used in a specific test. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
aa8249ae1b
commit
9b5e78888d
1 changed files with 13 additions and 0 deletions
|
@ -34,6 +34,13 @@ type testingT interface {
|
|||
Fatalf(string, ...interface{})
|
||||
}
|
||||
|
||||
type namer interface {
|
||||
Name() string
|
||||
}
|
||||
type testNamer interface {
|
||||
TestName() string
|
||||
}
|
||||
|
||||
type logT interface {
|
||||
Logf(string, ...interface{})
|
||||
}
|
||||
|
@ -96,6 +103,12 @@ func New(t testingT, ops ...func(*Daemon)) *Daemon {
|
|||
if dest == "" {
|
||||
dest = os.Getenv("DEST")
|
||||
}
|
||||
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")
|
||||
|
||||
storageDriver := os.Getenv("DOCKER_GRAPHDRIVER")
|
||||
|
|
Loading…
Add table
Reference in a new issue