Commit d57ec598 authored by Ed Bartosh's avatar Ed Bartosh

kubeadm: use T.Run API in app/apis/kubeadm

Used T.Run API for kubeadm tests in app/apis/kubeadm This should improve testing output and make it more visible which test is doing what.
parent 13e59ab9
...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) { ...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`}, {BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`},
} }
for _, rt := range tests { for _, rt := range tests {
b, err := json.Marshal(rt.bts) t.Run(rt.bts.ID, func(t *testing.T) {
if err != nil { b, err := json.Marshal(rt.bts)
t.Fatalf("json.Marshal returned an unexpected error: %v", err) if err != nil {
} t.Fatalf("json.Marshal returned an unexpected error: %v", err)
if string(b) != rt.expected { }
t.Errorf( if string(b) != rt.expected {
"failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s",
string(b), rt.expected,
) string(b),
} )
}
})
} }
} }
...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) { ...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) {
{`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false}, {`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false},
} }
for _, rt := range tests { for _, rt := range tests {
newbts := &BootstrapTokenString{} t.Run(rt.input, func(t *testing.T) {
err := json.Unmarshal([]byte(rt.input), newbts) newbts := &BootstrapTokenString{}
if (err != nil) != rt.expectedError { err := json.Unmarshal([]byte(rt.input), newbts)
t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err) if (err != nil) != rt.expectedError {
} else if !reflect.DeepEqual(rt.bts, newbts) { t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err)
t.Errorf( } else if !reflect.DeepEqual(rt.bts, newbts) {
"failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.bts, "failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v",
newbts, rt.bts,
) newbts,
} )
}
})
} }
} }
...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) { ...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) {
{"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, {"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
if err := roundtrip(rt.input, rt.bts); err != nil { t.Run(rt.input, func(t *testing.T) {
t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err) if err := roundtrip(rt.input, rt.bts); err != nil {
} t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err)
}
})
} }
} }
...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) { ...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"}, {BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"},
} }
for _, rt := range tests { for _, rt := range tests {
actual := rt.bts.String() t.Run(rt.bts.ID, func(t *testing.T) {
if actual != rt.expected { actual := rt.bts.String()
t.Errorf( if actual != rt.expected {
"failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s",
actual, rt.expected,
) actual,
} )
}
})
} }
} }
...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) { ...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) {
{token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenString(rt.token) t.Run(rt.token, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenString(rt.token)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v",
rt.expectedError, rt.token,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v",
rt.bts, rt.token,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) { ...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) {
{id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret) t.Run(rt.id, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v",
rt.secret, rt.id,
rt.expectedError, rt.secret,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v",
rt.secret, rt.id,
rt.bts, rt.secret,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) { ...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`}, {BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`},
} }
for _, rt := range tests { for _, rt := range tests {
b, err := json.Marshal(rt.bts) t.Run(rt.bts.ID, func(t *testing.T) {
if err != nil { b, err := json.Marshal(rt.bts)
t.Fatalf("json.Marshal returned an unexpected error: %v", err) if err != nil {
} t.Fatalf("json.Marshal returned an unexpected error: %v", err)
if string(b) != rt.expected { }
t.Errorf( if string(b) != rt.expected {
"failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s",
string(b), rt.expected,
) string(b),
} )
}
})
} }
} }
...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) { ...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) {
{`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false}, {`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false},
} }
for _, rt := range tests { for _, rt := range tests {
newbts := &BootstrapTokenString{} t.Run(rt.input, func(t *testing.T) {
err := json.Unmarshal([]byte(rt.input), newbts) newbts := &BootstrapTokenString{}
if (err != nil) != rt.expectedError { err := json.Unmarshal([]byte(rt.input), newbts)
t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err) if (err != nil) != rt.expectedError {
} else if !reflect.DeepEqual(rt.bts, newbts) { t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err)
t.Errorf( } else if !reflect.DeepEqual(rt.bts, newbts) {
"failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.bts, "failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v",
newbts, rt.bts,
) newbts,
} )
}
})
} }
} }
...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) { ...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) {
{"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, {"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
if err := roundtrip(rt.input, rt.bts); err != nil { t.Run(rt.input, func(t *testing.T) {
t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err) if err := roundtrip(rt.input, rt.bts); err != nil {
} t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err)
}
})
} }
} }
...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) { ...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"}, {BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"},
} }
for _, rt := range tests { for _, rt := range tests {
actual := rt.bts.String() t.Run(rt.bts.ID, func(t *testing.T) {
if actual != rt.expected { actual := rt.bts.String()
t.Errorf( if actual != rt.expected {
"failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s",
actual, rt.expected,
) actual,
} )
}
})
} }
} }
...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) { ...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) {
{token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenString(rt.token) t.Run(rt.token, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenString(rt.token)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v",
rt.expectedError, rt.token,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v",
rt.bts, rt.token,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) { ...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) {
{id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret) t.Run(rt.id, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v",
rt.secret, rt.id,
rt.expectedError, rt.secret,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v",
rt.secret, rt.id,
rt.bts, rt.secret,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
...@@ -46,13 +46,15 @@ func TestJoinConfigurationConversion(t *testing.T) { ...@@ -46,13 +46,15 @@ func TestJoinConfigurationConversion(t *testing.T) {
expectedError: true, expectedError: true,
}, },
} }
for _, tc := range testcases { for name, tc := range testcases {
internal := &kubeadm.JoinConfiguration{} t.Run(name, func(t *testing.T) {
err := Convert_v1alpha3_JoinConfiguration_To_kubeadm_JoinConfiguration(tc.old, internal, nil) internal := &kubeadm.JoinConfiguration{}
if (err != nil) != tc.expectedError { err := Convert_v1alpha3_JoinConfiguration_To_kubeadm_JoinConfiguration(tc.old, internal, nil)
t.Errorf("ImageToImageMeta returned unexpected error: %v, saw: %v", tc.expectedError, (err != nil)) if (err != nil) != tc.expectedError {
return t.Errorf("ImageToImageMeta returned unexpected error: %v, saw: %v", tc.expectedError, (err != nil))
} return
}
})
} }
} }
...@@ -76,12 +78,14 @@ func TestInitConfigurationConversion(t *testing.T) { ...@@ -76,12 +78,14 @@ func TestInitConfigurationConversion(t *testing.T) {
expectedErr: true, expectedErr: true,
}, },
} }
for _, tc := range testcases { for name, tc := range testcases {
internal := &kubeadm.InitConfiguration{} t.Run(name, func(t *testing.T) {
err := Convert_v1alpha3_InitConfiguration_To_kubeadm_InitConfiguration(tc.old, internal, nil) internal := &kubeadm.InitConfiguration{}
if (err != nil) != tc.expectedErr { err := Convert_v1alpha3_InitConfiguration_To_kubeadm_InitConfiguration(tc.old, internal, nil)
t.Errorf("no error was expected but '%s' was found", err) if (err != nil) != tc.expectedErr {
} t.Errorf("no error was expected but '%s' was found", err)
}
})
} }
} }
......
...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) { ...@@ -34,17 +34,19 @@ func TestMarshalJSON(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`}, {BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`},
} }
for _, rt := range tests { for _, rt := range tests {
b, err := json.Marshal(rt.bts) t.Run(rt.bts.ID, func(t *testing.T) {
if err != nil { b, err := json.Marshal(rt.bts)
t.Fatalf("json.Marshal returned an unexpected error: %v", err) if err != nil {
} t.Fatalf("json.Marshal returned an unexpected error: %v", err)
if string(b) != rt.expected { }
t.Errorf( if string(b) != rt.expected {
"failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.MarshalJSON:\n\texpected: %s\n\t actual: %s",
string(b), rt.expected,
) string(b),
} )
}
})
} }
} }
...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) { ...@@ -64,17 +66,19 @@ func TestUnmarshalJSON(t *testing.T) {
{`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false}, {`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false},
} }
for _, rt := range tests { for _, rt := range tests {
newbts := &BootstrapTokenString{} t.Run(rt.input, func(t *testing.T) {
err := json.Unmarshal([]byte(rt.input), newbts) newbts := &BootstrapTokenString{}
if (err != nil) != rt.expectedError { err := json.Unmarshal([]byte(rt.input), newbts)
t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err) if (err != nil) != rt.expectedError {
} else if !reflect.DeepEqual(rt.bts, newbts) { t.Errorf("failed BootstrapTokenString.UnmarshalJSON:\n\texpected error: %t\n\t actual error: %v", rt.expectedError, err)
t.Errorf( } else if !reflect.DeepEqual(rt.bts, newbts) {
"failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.bts, "failed BootstrapTokenString.UnmarshalJSON:\n\texpected: %v\n\t actual: %v",
newbts, rt.bts,
) newbts,
} )
}
})
} }
} }
...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) { ...@@ -87,9 +91,11 @@ func TestJSONRoundtrip(t *testing.T) {
{"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, {"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
if err := roundtrip(rt.input, rt.bts); err != nil { t.Run(rt.input, func(t *testing.T) {
t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err) if err := roundtrip(rt.input, rt.bts); err != nil {
} t.Errorf("failed BootstrapTokenString JSON roundtrip with error: %v", err)
}
})
} }
} }
...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) { ...@@ -140,14 +146,16 @@ func TestTokenFromIDAndSecret(t *testing.T) {
{BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"}, {BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"},
} }
for _, rt := range tests { for _, rt := range tests {
actual := rt.bts.String() t.Run(rt.bts.ID, func(t *testing.T) {
if actual != rt.expected { actual := rt.bts.String()
t.Errorf( if actual != rt.expected {
"failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s", t.Errorf(
rt.expected, "failed BootstrapTokenString.String():\n\texpected: %s\n\t actual: %s",
actual, rt.expected,
) actual,
} )
}
})
} }
} }
...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) { ...@@ -175,22 +183,24 @@ func TestNewBootstrapTokenString(t *testing.T) {
{token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenString(rt.token) t.Run(rt.token, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenString(rt.token)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected error: %t\n\t actual error: %v",
rt.expectedError, rt.token,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.token, "failed NewBootstrapTokenString for the token %q\n\texpected: %v\n\t actual: %v",
rt.bts, rt.token,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) { ...@@ -215,23 +225,25 @@ func TestNewBootstrapTokenStringFromIDAndSecret(t *testing.T) {
{id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, {id: "123456", secret: "1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}},
} }
for _, rt := range tests { for _, rt := range tests {
actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret) t.Run(rt.id, func(t *testing.T) {
if (err != nil) != rt.expectedError { actual, err := NewBootstrapTokenStringFromIDAndSecret(rt.id, rt.secret)
t.Errorf( if (err != nil) != rt.expectedError {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected error: %t\n\t actual error: %v",
rt.secret, rt.id,
rt.expectedError, rt.secret,
err, rt.expectedError,
) err,
} else if !reflect.DeepEqual(actual, rt.bts) { )
t.Errorf( } else if !reflect.DeepEqual(actual, rt.bts) {
"failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v", t.Errorf(
rt.id, "failed NewBootstrapTokenStringFromIDAndSecret for the token with id %q and secret %q\n\texpected: %v\n\t actual: %v",
rt.secret, rt.id,
rt.bts, rt.secret,
actual, rt.bts,
) actual,
} )
}
})
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment