pbacsko commented on code in PR #465:
URL: https://github.com/apache/yunikorn-core/pull/465#discussion_r1039664537
##########
pkg/webservice/handlers_test.go:
##########
@@ -1367,6 +1413,32 @@ func TestUsersAndGroupsResourceUsage(t *testing.T) {
assert.NilError(t, err, "failed to unmarshal groups resource usage dao
response from response body: %s", string(resp.outputBytes))
assert.Equal(t, groupsResourceUsageDao[0].Queues.ResourceUsage.String(),
resources.NewResourceFromMap(map[string]resources.Quantity{siCommon.CPU:
1}).String())
+
+ // Test existed group query
+ req, err = http.NewRequest("GET",
"/ws/v1/partition/default/usage/group/testgroup", strings.NewReader(""))
+ assert.NilError(t, err, "Get Group Resource Usage Handler request
failed")
+ vars = map[string]string{
+ "user": "testuser",
+ "group": "testgroup",
+ }
+ req = mux.SetURLVars(req, vars)
+ var groupResourceUsageDao *dao.GroupResourceUsageDAOInfo
+ getGroupResourceUsage(resp, req)
+ err = json.Unmarshal(resp.outputBytes, &groupResourceUsageDao)
+ assert.NilError(t, err, "failed to unmarshal group resource usage dao
response from response body: %s", string(resp.outputBytes))
+ assert.Equal(t, groupResourceUsageDao.Queues.ResourceUsage.String(),
+
resources.NewResourceFromMap(map[string]resources.Quantity{siCommon.CPU:
1}).String())
+
+ // Test not existed group query
Review Comment:
Nit: non-existing
--
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]