Permalink
Browse files

Update dep github.com/skeema/tengo for Docker client refactor

This only affects the test suites so far.
  • Loading branch information...
evanelias committed Nov 2, 2018
1 parent 5aa6168 commit 2e3a86067f4fe42c80694b65a350efbfd50aae46
Showing with 110 additions and 97 deletions.
  1. +2 −2 Gopkg.lock
  2. +11 −13 applier/applier_test.go
  3. +7 −9 skeema_test.go
  4. +83 −64 vendor/github.com/skeema/tengo/docker.go
  5. +7 −9 workspace/workspace_test.go
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -48,9 +48,7 @@ func TestIntegration(t *testing.T) {
fmt.Println("To run integration tests, you may set SKEEMA_TEST_IMAGES to a comma-separated")
fmt.Println("list of Docker images. Example:\n# SKEEMA_TEST_IMAGES=\"mysql:5.6,mysql:5.7\" go test")
}
manager, err := tengo.NewDockerSandboxer(tengo.SandboxerOptions{
RootPassword: "fakepw",
})
manager, err := tengo.NewDockerClient(tengo.DockerClientOptions{})
if err != nil {
t.Errorf("Unable to create sandbox manager: %s", err)
}
@@ -59,7 +57,7 @@ func TestIntegration(t *testing.T) {
}
type ApplierIntegrationSuite struct {
manager *tengo.DockerSandboxer
manager *tengo.DockerClient
d []*tengo.DockerizedInstance
}
@@ -70,7 +68,15 @@ func (s *ApplierIntegrationSuite) Setup(backend string) error {
n := n
g.Go(func() error {
var err error
s.d[n], err = s.manager.GetOrCreateInstance(containerName(backend, n), backend)
containerName := fmt.Sprintf("skeema-test-%s", strings.Replace(backend, ":", "-", -1))
if n > 0 {
containerName = fmt.Sprintf("%s-%d", containerName, n+1)
}
s.d[n], err = s.manager.GetOrCreateInstance(tengo.DockerizedInstanceOptions{
Name: containerName,
Image: backend,
RootPassword: "fakepw",
})
return err
})
}
@@ -98,11 +104,3 @@ func (s *ApplierIntegrationSuite) BeforeTest(method string, backend string) erro
}
return g.Wait()
}
func containerName(backend string, n int) string {
base := fmt.Sprintf("skeema-test-%s", strings.Replace(backend, ":", "-", -1))
if n == 0 {
return base
}
return fmt.Sprintf("%s-%d", base, n+1)
}
View
@@ -34,9 +34,7 @@ func TestIntegration(t *testing.T) {
fmt.Println("To run integration tests, you may set SKEEMA_TEST_IMAGES to a comma-separated")
fmt.Println("list of Docker images. Example:\n# SKEEMA_TEST_IMAGES=\"mysql:5.6,mysql:5.7\" go test")
}
manager, err := tengo.NewDockerSandboxer(tengo.SandboxerOptions{
RootPassword: "fakepw",
})
manager, err := tengo.NewDockerClient(tengo.DockerClientOptions{})
if err != nil {
t.Errorf("Unable to create sandbox manager: %s", err)
}
@@ -45,7 +43,7 @@ func TestIntegration(t *testing.T) {
}
type SkeemaIntegrationSuite struct {
manager *tengo.DockerSandboxer
manager *tengo.DockerClient
d *tengo.DockerizedInstance
repoPath string
}
@@ -58,7 +56,11 @@ func (s *SkeemaIntegrationSuite) Setup(backend string) (err error) {
}
// Spin up a Dockerized database server
s.d, err = s.manager.GetOrCreateInstance(containerName(backend), backend)
s.d, err = s.manager.GetOrCreateInstance(tengo.DockerizedInstanceOptions{
Name: fmt.Sprintf("skeema-test-%s", strings.Replace(backend, ":", "-", -1)),
Image: backend,
RootPassword: "fakepw",
})
return err
}
@@ -390,10 +392,6 @@ func (s *SkeemaIntegrationSuite) dbExec(t *testing.T, schemaName, query string,
}
}
func containerName(backend string) string {
return fmt.Sprintf("skeema-test-%s", strings.Replace(backend, ":", "-", -1))
}
// getOptionFile returns a mybase.File representing the .skeema file in the
// specified directory
func getOptionFile(t *testing.T, basePath string, baseConfig *mybase.Config) *mybase.File {

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 2e3a860

Please sign in to comment.