Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
alphanota committed Jan 16, 2025
1 parent 0787e5a commit 10ed9ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion integration/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,17 @@ func TestRunWithDockerAndBuildArgs(t *testing.T) {

defer skaffold.Delete().InDir(test.projectDir).Run(t.T)
expected := "IMAGE_REPO: gcr.io/k8s-skaffold, IMAGE_NAME: skaffold, IMAGE_TAG:latest"
got := ""

err := wait.PollImmediate(time.Millisecond*500, 1*time.Minute, func() (bool, error) {
out, _ := exec.Command("docker", "run", "child:latest").Output()
return string(out) == expected, nil
got = strings.Trim(string(out), " \n")
return got == expected, nil
})

if err != nil {
t.Errorf("docker run produced incorrect output, got:[%s], want:[%s], err: %v", got, expected, err )
}
failNowIfError(t, err)
})
}
Expand Down
3 changes: 2 additions & 1 deletion integration/testdata/docker-run-with-build-args/base/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ var ImageTag = "unknown"
var ImageName = "unknown"

func main() {
fmt.Printf("IMAGE_REPO: %s, IMAGE_NAME: %s, IMAGE_TAG:%s\n", ImageRepo, ImageName, ImageTag)
output := fmt.Sprintf("IMAGE_REPO: %s, IMAGE_NAME: %s, IMAGE_TAG:%s\n", ImageRepo, ImageName, ImageTag)
fmt.Println(output)
}

0 comments on commit 10ed9ec

Please sign in to comment.