зеркало из https://github.com/microsoft/docker.git
Remove timer and use -check.v for tests formatting
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Родитель
d7544217dd
Коммит
4253a1f87e
|
@ -2,6 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
bundle_test_integration_cli() {
|
bundle_test_integration_cli() {
|
||||||
|
TESTFLAGS="$TESTFLAGS -check.v"
|
||||||
go_test_dir ./integration-cli
|
go_test_dir ./integration-cli
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
@ -12,30 +10,16 @@ func Test(t *testing.T) {
|
||||||
check.TestingT(t)
|
check.TestingT(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TimerSuite struct {
|
|
||||||
start time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *TimerSuite) SetUpTest(c *check.C) {
|
|
||||||
s.start = time.Now()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *TimerSuite) TearDownTest(c *check.C) {
|
|
||||||
fmt.Printf("%-60s%.2f\n", c.TestName(), time.Since(s.start).Seconds())
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
check.Suite(&DockerSuite{})
|
check.Suite(&DockerSuite{})
|
||||||
}
|
}
|
||||||
|
|
||||||
type DockerSuite struct {
|
type DockerSuite struct {
|
||||||
TimerSuite
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TearDownTest(c *check.C) {
|
func (s *DockerSuite) TearDownTest(c *check.C) {
|
||||||
deleteAllContainers()
|
deleteAllContainers()
|
||||||
deleteAllImages()
|
deleteAllImages()
|
||||||
s.TimerSuite.TearDownTest(c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -51,7 +35,6 @@ type DockerRegistrySuite struct {
|
||||||
|
|
||||||
func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
|
func (s *DockerRegistrySuite) SetUpTest(c *check.C) {
|
||||||
s.reg = setupRegistry(c)
|
s.reg = setupRegistry(c)
|
||||||
s.ds.SetUpTest(c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
|
func (s *DockerRegistrySuite) TearDownTest(c *check.C) {
|
||||||
|
@ -72,7 +55,6 @@ type DockerDaemonSuite struct {
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
|
func (s *DockerDaemonSuite) SetUpTest(c *check.C) {
|
||||||
s.d = NewDaemon(c)
|
s.d = NewDaemon(c)
|
||||||
s.ds.SetUpTest(c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
|
func (s *DockerDaemonSuite) TearDownTest(c *check.C) {
|
||||||
|
|
|
@ -40,7 +40,6 @@ type DockerExternalVolumeSuite struct {
|
||||||
|
|
||||||
func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {
|
func (s *DockerExternalVolumeSuite) SetUpTest(c *check.C) {
|
||||||
s.d = NewDaemon(c)
|
s.d = NewDaemon(c)
|
||||||
s.ds.SetUpTest(c)
|
|
||||||
s.ec = &eventCounter{}
|
s.ec = &eventCounter{}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче