From f44d29f4dffa825dd0f98a1b2624419525f60e2a Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Tue, 11 Aug 2020 17:00:37 +0200 Subject: [PATCH] Fix the rm test without force mutlierror didn't append an `Error:` if there is only one error... --- multierror/multierror.go | 2 +- multierror/multierror_test.go | 2 +- tests/aci-e2e/e2e-aci_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/multierror/multierror.go b/multierror/multierror.go index e1c15eadf..2b112dad4 100644 --- a/multierror/multierror.go +++ b/multierror/multierror.go @@ -95,7 +95,7 @@ func Append(err error, errs ...error) *Error { func listErrorFunc(errs []error) string { if len(errs) == 1 { - return errs[0].Error() + return "Error: " + errs[0].Error() } messages := make([]string, len(errs)) diff --git a/multierror/multierror_test.go b/multierror/multierror_test.go index c1e097670..1d2c58c3f 100644 --- a/multierror/multierror_test.go +++ b/multierror/multierror_test.go @@ -61,5 +61,5 @@ func TestErrorOrNil(t *testing.T) { err = Append(err, errors.New("error")) e := err.ErrorOrNil() - assert.Error(t, e, "error") + assert.Error(t, e, "Error: error") } diff --git a/tests/aci-e2e/e2e-aci_test.go b/tests/aci-e2e/e2e-aci_test.go index 7d5608600..b835f64a5 100644 --- a/tests/aci-e2e/e2e-aci_test.go +++ b/tests/aci-e2e/e2e-aci_test.go @@ -268,7 +268,7 @@ func TestContainerRun(t *testing.T) { t.Run("rm a running container", func(t *testing.T) { res := c.RunDockerCmd("rm", container) res.Assert(t, icmd.Expected{ - Err: fmt.Sprintf("Error: You cannot remove a running container %s. Stop the container before attempting removal or force remove\n", container), + Err: fmt.Sprintf("Error: you cannot remove a running container %s. Stop the container before attempting removal or force remove", container), ExitCode: 1, }) })