baconYao commented on code in PR #917:
URL: https://github.com/apache/yunikorn-core/pull/917#discussion_r1683103660


##########
pkg/webservice/handlers_test.go:
##########
@@ -2007,6 +2016,14 @@ func TestSpecificGroupResourceUsage(t *testing.T) {
        assert.Equal(t, http.StatusBadRequest, resp.statusCode, statusCodeError)
        assert.Equal(t, errInfo.Message, "invalid URL escape \"%Zt\"", 
jsonMessageError)
        assert.Equal(t, errInfo.StatusCode, http.StatusBadRequest)
+
+       // Test invalid group name according to GroupRegExp
+       invalidGroupName := "invalid_group@name"
+       req, err = createRequest(t, "/ws/v1/partition/default/usage/group", 
map[string]string{"user": "testuser", "group": invalidGroupName})
+       assert.NilError(t, err)
+       resp = &MockResponseWriter{}
+       getGroupResourceUsage(resp, req)
+       assertInvalidGroupName(t, resp)

Review Comment:
   I think this piece of code duplicates another 
[one](https://github.com/apache/yunikorn-core/pull/905/files#diff-c547735b58862d5573852f5e2c6a17c723f81a5620f3658172dd1b321f035975R2016-R2021).
   
   I think the change of line 
[2001](https://github.com/apache/yunikorn-core/pull/917/files#diff-c547735b58862d5573852f5e2c6a17c723f81a5620f3658172dd1b321f035975R2001)
 is enough to cover what you implemented in 
[handlers.go](https://github.com/apache/yunikorn-core/pull/917/files#diff-c547735b58862d5573852f5e2c6a17c723f81a5620f3658172dd1b321f035975R2001)



-- 
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