diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-08-25 16:41:47 +0200 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2021-08-25 18:56:04 +0200 |
commit | 8b17d1006138b964317cdc7f8fb52f255bfe500c (patch) | |
tree | 879351df186d7e2b614a3d1a64ac30c6037bf64d /client/go/cmd/deploy_test.go | |
parent | 240fb94f82b8a59e70135deee6bc870e8ced2673 (diff) |
Avoid colorization of unrelated output
Diffstat (limited to 'client/go/cmd/deploy_test.go')
-rw-r--r-- | client/go/cmd/deploy_test.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/client/go/cmd/deploy_test.go b/client/go/cmd/deploy_test.go index 45fbe95a094..9042bc2c2a8 100644 --- a/client/go/cmd/deploy_test.go +++ b/client/go/cmd/deploy_test.go @@ -5,15 +5,16 @@ package cmd import ( - "github.com/stretchr/testify/assert" "strconv" "testing" + + "github.com/stretchr/testify/assert" ) func TestDeployZip(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip"}, []string{})) assertDeployRequestMade("http://127.0.0.1:19071", client, t) } @@ -21,7 +22,7 @@ func TestDeployZip(t *testing.T) { func TestDeployZipWithURLTargetArgument(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip", "-t", "http://target:19071"}, []string{})) assertDeployRequestMade("http://target:19071", client, t) } @@ -29,7 +30,7 @@ func TestDeployZipWithURLTargetArgument(t *testing.T) { func TestDeployZipWitLocalTargetArgument(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip", "-t", "local"}, []string{})) assertDeployRequestMade("http://127.0.0.1:19071", client, t) } @@ -37,7 +38,7 @@ func TestDeployZipWitLocalTargetArgument(t *testing.T) { func TestDeploySourceDirectory(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withSource/src/main/application"}, []string{})) assertDeployRequestMade("http://127.0.0.1:19071", client, t) } @@ -45,7 +46,7 @@ func TestDeploySourceDirectory(t *testing.T) { func TestDeployApplicationDirectoryWithSource(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withSource"}, []string{})) assertDeployRequestMade("http://127.0.0.1:19071", client, t) } @@ -53,7 +54,7 @@ func TestDeployApplicationDirectoryWithSource(t *testing.T) { func TestDeployApplicationDirectoryWithTarget(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[32mSuccess\n", + "\x1b[32mSuccess\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget"}, []string{})) assertDeployRequestMade("http://127.0.0.1:19071", client, t) } @@ -61,7 +62,7 @@ func TestDeployApplicationDirectoryWithTarget(t *testing.T) { func TestDeployApplicationDirectoryWithEmptyTarget(t *testing.T) { client := &mockHttpClient{} assert.Equal(t, - "\x1b[31mtarget/ exists but have no application.zip. Run mvn package first\n", + "\x1b[31mno application package found in testdata/applications/withEmptyTarget\x1b[0m\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withEmptyTarget"}, []string{})) } @@ -89,13 +90,13 @@ func assertDeployRequestMade(target string, client *mockHttpClient, t *testing.T func assertApplicationPackageError(t *testing.T, status int, errorMessage string) { client := &mockHttpClient{nextStatus: status, nextBody: errorMessage} assert.Equal(t, - "\x1b[31mInvalid application package (Status "+strconv.Itoa(status)+"):\n"+errorMessage+"\n", + "\x1b[31mInvalid application package (Status "+strconv.Itoa(status)+"):\x1b[0m\n"+errorMessage+"\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip"}, []string{})) } func assertDeployServerError(t *testing.T, status int, errorMessage string) { client := &mockHttpClient{nextStatus: status, nextBody: errorMessage} assert.Equal(t, - "\x1b[31mError from deploy service at 127.0.0.1:19071 (Status "+strconv.Itoa(status)+"):\n"+errorMessage+"\n", + "\x1b[31mError from deploy service at 127.0.0.1:19071 (Status "+strconv.Itoa(status)+"):\x1b[0m\n"+errorMessage+"\n", executeCommand(t, client, []string{"deploy", "testdata/applications/withTarget/target/application.zip"}, []string{})) } |