Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1728 from bukhavtsov/feature/refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof authored Jun 2, 2021
2 parents 3ec33fa + 610f34f commit db30ef7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ func (c *E2eCLI) NewDockerCmd(args ...string) icmd.Cmd {

// RunDockerOrExitError runs a docker command and returns a result
func (c *E2eCLI) RunDockerOrExitError(args ...string) *icmd.Result {
fmt.Printf(" [%s] docker %s\n", c.test.Name(), strings.Join(args, " "))
fmt.Printf("\t[%s] docker %s\n", c.test.Name(), strings.Join(args, " "))
return icmd.RunCmd(c.NewDockerCmd(args...))
}

// RunCmd runs a command, expects no error and returns a result
func (c *E2eCLI) RunCmd(args ...string) *icmd.Result {
fmt.Printf(" [%s] %s\n", c.test.Name(), strings.Join(args, " "))
fmt.Printf("\t[%s] %s\n", c.test.Name(), strings.Join(args, " "))
assert.Assert(c.test, len(args) >= 1, "require at least one command in parameters")
res := icmd.RunCmd(c.NewCmd(args[0], args[1:]...))
res.Assert(c.test, icmd.Success)
Expand All @@ -247,7 +247,7 @@ func (c *E2eCLI) WaitForCmdResult(command icmd.Cmd, predicate func(*icmd.Result)
assert.Assert(c.test, timeout.Nanoseconds() > delay.Nanoseconds(), "timeout must be greater than delay")
var res *icmd.Result
checkStopped := func(logt poll.LogT) poll.Result {
fmt.Printf(" [%s] %s\n", c.test.Name(), strings.Join(command.Command, " "))
fmt.Printf("\t[%s] %s\n", c.test.Name(), strings.Join(command.Command, " "))
res = icmd.RunCmd(command)
if !predicate(res) {
return poll.Continue("Cmd output did not match requirement: %q", res.Combined())
Expand Down Expand Up @@ -302,7 +302,7 @@ func HTTPGetWithRetry(t *testing.T, endpoint string, expectedStatus int, retryDe
client := &http.Client{
Timeout: retryDelay,
}
fmt.Printf(" [%s] GET %s\n", t.Name(), endpoint)
fmt.Printf("\t[%s] GET %s\n", t.Name(), endpoint)
checkUp := func(t poll.LogT) poll.Result {
r, err = client.Get(endpoint)
if err != nil {
Expand Down

0 comments on commit db30ef7

Please sign in to comment.