Skip to content

Commit

Permalink
fix: stale global variable
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Alvarez <[email protected]>
  • Loading branch information
pendo324 committed Mar 26, 2024
1 parent 48d86dd commit d9d2e98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/compose_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import (
func ComposeLogs(o *option.Option) {
services := []string{"svc1_compose_logs", "svc2_compose_logs"}
containerNames := []string{"container1_compose_logs", "container2_compose_logs"}
imageNames := []string{localImages[defaultImage], localImages[defaultImage]}

ginkgo.Describe("Compose logs command", func() {
var buildContext string
var composeFilePath string
var imageNames []string

ginkgo.BeforeEach(func() {
imageNames = []string{localImages[defaultImage], localImages[defaultImage]}
command.RemoveAll(o)
buildContext, composeFilePath = createComposeYmlForLogsCmd(services, imageNames, containerNames)
ginkgo.DeferCleanup(os.RemoveAll, buildContext)
Expand Down
4 changes: 3 additions & 1 deletion tests/compose_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ import (
func ComposePs(o *option.Option) {
services := []string{"svc1_compose_ps", "svc2_compose_ps"}
containerNames := []string{"container1_compose_ps", "container2_compose_ps"}
imageNames := []string{localImages[defaultImage], localImages[defaultImage]}

ginkgo.Describe("Compose ps command", func() {
var composeContext string
var composeFilePath string
var imageNames []string

ginkgo.BeforeEach(func() {
imageNames = []string{localImages[defaultImage], localImages[defaultImage]}
command.RemoveAll(o)
composeContext, composeFilePath = createComposeYmlForPsCmd(services, imageNames, containerNames)
ginkgo.DeferCleanup(os.RemoveAll, composeContext)
Expand Down
4 changes: 3 additions & 1 deletion tests/compose_pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import (
// ComposePull tests functionality of `compose pull` command.
func ComposePull(o *option.Option) {
services := []string{"svc1_compose_pull", "svc2_compose_pull"}
imageNames := []string{localImages[defaultImage], localImages[olderAlpineImage]}
ginkgo.Describe("Compose pull command", func() {
var composeContext string
var composeFilePath string
var imageNames []string

ginkgo.BeforeEach(func() {
imageNames = []string{localImages[defaultImage], localImages[olderAlpineImage]}
command.RemoveAll(o)
composeContext, composeFilePath = createComposeYmlForPullCmd(services, imageNames)
ginkgo.DeferCleanup(os.RemoveAll, composeContext)
Expand Down
4 changes: 3 additions & 1 deletion tests/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ func SetupLocalRegistry(o *option.Option) {
// split image tag according to spec
// https://github.com/distribution/distribution/blob/d0deff9cd6c2b8c82c6f3d1c713af51df099d07b/reference/reference.go
_, name, _ := strings.Cut(ref, "/")
command.Run(o, "pull", ref)
// allow up to a minute for remote pulls to account for external network
// latency/throughput issues or throttling (default is 10 seconds)
command.New(o, "pull", ref).WithTimeoutInSeconds(60).Run()
localRef := fmt.Sprintf("localhost:%d/%s", hostPort, name)
command.Run(o, "tag", ref, localRef)
command.Run(o, "push", localRef)
Expand Down

0 comments on commit d9d2e98

Please sign in to comment.