pbacsko commented on code in PR #950:
URL: https://github.com/apache/yunikorn-k8shim/pull/950#discussion_r1950429729


##########
pkg/admission/admission_controller_test.go:
##########
@@ -568,7 +568,9 @@ func TestMutate(t *testing.T) {
        assert.Check(t, resp.Allowed, "response not allowed for unknown object 
type")
        assert.Check(t, len(resp.Patch) > 0, "empty patch for deployment")
        annotations := annotationsFromDeployment(t, resp.Patch)
-       assert.Equal(t, annotations[common.UserInfoAnnotation].(string), 
"{\"user\":\"testExtUser\"}")
+       annotationValue, ok := annotations[common.UserInfoAnnotation].(string)
+       assert.Check(t, ok, "UserInfoAnnotation value is not a string")

Review Comment:
   nit: it's more reasonable to just bail out with `assert.Assert()`. It makes 
no sense to continue the test in such cases (also applies to lines 844, 856, 
868).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to