From d104448a009f529bfb080a05ed24507d7f3ee00b Mon Sep 17 00:00:00 2001 From: crgisch Date: Tue, 22 Oct 2024 17:00:31 -0300 Subject: [PATCH] fix: check correct message for successful deploy --- tsuru/client/deploy.go | 2 +- tsuru/client/deploy_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tsuru/client/deploy.go b/tsuru/client/deploy.go index 51ec3ae1..a2fb6c9a 100644 --- a/tsuru/client/deploy.go +++ b/tsuru/client/deploy.go @@ -732,7 +732,7 @@ Use the --job/-j flag to specify it. if readErr != io.EOF { return fmt.Errorf("error reading response: %v", readErr) } - if strings.HasSuffix(buf.String(), "\nOK\n") { + if strings.HasSuffix(buf.String(), "\nDeploy finished with success!\n") { return nil } return cmd.ErrAbortCommand diff --git a/tsuru/client/deploy_test.go b/tsuru/client/deploy_test.go index f098b17c..cebee9fc 100644 --- a/tsuru/client/deploy_test.go +++ b/tsuru/client/deploy_test.go @@ -570,7 +570,7 @@ func (s *S) TestJobDeployRunUsingDockerfile(c *check.C) { ctx := &cmd.Context{Stdout: io.Discard, Stderr: io.Discard, Args: command.Flags().Args()} trans := &cmdtest.ConditionalTransport{ - Transport: cmdtest.Transport{Message: "deployed\nOK\n", Status: http.StatusOK}, + Transport: cmdtest.Transport{Message: "deployed\nDeploy finished with success!\n", Status: http.StatusOK}, CondFunc: func(req *http.Request) bool { if req.Body != nil { defer req.Body.Close() @@ -598,7 +598,7 @@ func (s *S) TestJobDeployRunUsingDockerfile(c *check.C) { func (s *S) TestJobDeployRunUsingImage(c *check.C) { trans := cmdtest.ConditionalTransport{ - Transport: cmdtest.Transport{Message: "deploy worked\nOK\n", Status: http.StatusOK}, + Transport: cmdtest.Transport{Message: "deploy worked\nDeploy finished with success!\n", Status: http.StatusOK}, CondFunc: func(req *http.Request) bool { if req.Body != nil { defer req.Body.Close() @@ -698,7 +698,7 @@ func (s *S) TestJobDeployRunWithMessage(c *check.C) { c.Assert(err, check.IsNil) trans := cmdtest.ConditionalTransport{ - Transport: cmdtest.Transport{Message: "deploy worked\nOK\n", Status: http.StatusOK}, + Transport: cmdtest.Transport{Message: "deploy worked\nDeploy finished with success!\n", Status: http.StatusOK}, CondFunc: func(req *http.Request) bool { if req.Body != nil { defer req.Body.Close()