Merge pull request #96906 from Rajalakshmi-Girish/issue-96853

Fixes the unit tests to be more tolerant with error messages

Kubernetes-commit: 10c1c3acf65cfb00de7fa28f784865bd42ab4872
This commit is contained in:
Kubernetes Publisher
2021-01-05 17:09:51 -08:00
4 changed files with 11 additions and 10 deletions

4
Godeps/Godeps.json generated
View File

@@ -460,11 +460,11 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "9c6b1a9487e0"
"Rev": "9ab310c4912f"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "15c5dba13c59"
"Rev": "0ca7b349afd2"
},
{
"ImportPath": "k8s.io/gengo",

8
go.mod
View File

@@ -26,14 +26,14 @@ require (
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0
k8s.io/apimachinery v0.0.0-20201209085528-15c5dba13c59
k8s.io/api v0.0.0-20210105210245-9ab310c4912f
k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2
k8s.io/klog/v2 v2.4.0
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
sigs.k8s.io/yaml v1.2.0
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20201209085528-15c5dba13c59
k8s.io/api => k8s.io/api v0.0.0-20210105210245-9ab310c4912f
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2
)

4
go.sum
View File

@@ -427,8 +427,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20201218085720-9c6b1a9487e0/go.mod h1:RfHTN0YuX1yj8GjBNCMS6JbbdmX/jjszu9vXIt47SpM=
k8s.io/apimachinery v0.0.0-20201209085528-15c5dba13c59/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/api v0.0.0-20210105210245-9ab310c4912f/go.mod h1:ugSMEpFie0GsLA3IjyrjlN2Qh3uydrt9YCmiq35Uwk0=
k8s.io/apimachinery v0.0.0-20210103120354-0ca7b349afd2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU=
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ=

View File

@@ -18,6 +18,7 @@ package remotecommand
import (
"fmt"
"strings"
"testing"
)
@@ -36,7 +37,7 @@ func TestV4ErrorDecoder(t *testing.T) {
},
{
message: "{",
err: "error stream protocol error: unexpected end of JSON input in \"{\"",
err: "unexpected end of JSON input in \"{\"",
},
{
message: `{"status": "Success" }`,
@@ -64,7 +65,7 @@ func TestV4ErrorDecoder(t *testing.T) {
if want == "" {
want = "<nil>"
}
if got := fmt.Sprintf("%v", err); got != want {
if got := fmt.Sprintf("%v", err); !strings.Contains(got, want) {
t.Errorf("wrong error for message %q: want=%q, got=%q", test.message, want, got)
}
}