You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2022/12/11 13:36:21 UTC

[GitHub] [yunikorn-core] zhuqi-lucas opened a new pull request, #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

zhuqi-lucas opened a new pull request, #472:
URL: https://github.com/apache/yunikorn-core/pull/472

   ### What is this PR for?
   We need to add testing: to make sure multiple users with the same group trigger the correct updates etc.
   
   ### What type of PR is it?
   * [ ] - Bug Fix
   * [ ] - Improvement
   * [ ] - Feature
   * [ ] - Documentation
   * [ ] - Hot Fix
   * [ ] - Refactoring
   
   ### Todos
   * [ ] - Task
   
   ### What is the Jira issue?
   * Open an issue on Jira https://issues.apache.org/jira/browse/YUNIKORN-1428
   * Put link here, and add [YUNIKORN-*Jira number*] in PR title, eg. `[YUNIKORN-2] Gang scheduling interface parameters`
   
   ### How should this be tested?
   
   ### Screenshots (if appropriate)
   
   ### Questions:
   * [ ] - The licenses files need update.
   * [ ] - There is breaking changes for older versions.
   * [ ] - It needs documentation.
   


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] wilfred-s commented on a diff in pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

Posted by GitBox <gi...@apache.org>.
wilfred-s commented on code in PR #472:
URL: https://github.com/apache/yunikorn-core/pull/472#discussion_r1045400883


##########
pkg/scheduler/objects/application_test.go:
##########
@@ -90,15 +90,15 @@ func TestNewApplication(t *testing.T) {
 	if app.rmEventHandler == nil {
 		t.Fatal("non nil handler was not set in the new app")
 	}
-	assertUserGroupResource(t, getTestUserGroup(), nil)
+	assertUserGroupResource(t, getTestUserGroup("testuser", []string{"testgroup"}), nil, nil, 0)

Review Comment:
   Same as before: if you need the ability to check user and group separately you add a new function for it instead of changing 50+ callers.



##########
pkg/scheduler/objects/application_state_test.go:
##########
@@ -29,7 +29,7 @@ import (
 
 func TestAcceptStateTransition(t *testing.T) {
 	// Accept only from new
-	app := newApplication("app-00001", "default", "root.a")
+	app := newApplication("app-00001", "default", "root.a", "testuser", []string{"testgroup"})

Review Comment:
   Instead of changing all calls (70+ invocations) which already use this same user as they initialise the app indirectly via the calls:
   ```
   newApplication(...)
       newApplicationWithTags(...)
           NewApplication(siApp, getTestUserGroup(), nil, "")
   ```
   Add a new call that allows specifying the user and group.



##########
pkg/scheduler/objects/utilities_test.go:
##########
@@ -224,14 +224,14 @@ func newAllocationAskAll(allocKey, appID, taskGroup string, res *resources.Resou
 	return NewAllocationAskFromSI(ask)
 }
 
-func getTestUserGroup() security.UserGroup {
-	return security.UserGroup{User: "testuser", Groups: []string{"testgroup"}}
+func getTestUserGroup(userName string, groupNameList []string) security.UserGroup {

Review Comment:
   Same here: use a separate function `getUserGroup(userName string, groupNameList []string) security.UserGroup` You can even make `getTestUserGroup()` call that one with the default test user details: `"testuser", []string{"testgroup"}`



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] wilfred-s closed pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

Posted by GitBox <gi...@apache.org>.
wilfred-s closed pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases
URL: https://github.com/apache/yunikorn-core/pull/472


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] codecov[bot] commented on pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #472:
URL: https://github.com/apache/yunikorn-core/pull/472#issuecomment-1345566301

   # [Codecov](https://codecov.io/gh/apache/yunikorn-core/pull/472?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#472](https://codecov.io/gh/apache/yunikorn-core/pull/472?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d000c3c) into [master](https://codecov.io/gh/apache/yunikorn-core/commit/020bbd8544fd29743b2284e473695221de552826?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (020bbd8) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   ```diff
   @@           Coverage Diff           @@
   ##           master     #472   +/-   ##
   =======================================
     Coverage   72.88%   72.88%           
   =======================================
     Files          67       67           
     Lines       10057    10057           
   =======================================
     Hits         7330     7330           
     Misses       2482     2482           
     Partials      245      245           
   ```
   
   
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] zhuqi-lucas commented on a diff in pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

Posted by GitBox <gi...@apache.org>.
zhuqi-lucas commented on code in PR #472:
URL: https://github.com/apache/yunikorn-core/pull/472#discussion_r1048642480


##########
pkg/scheduler/objects/utilities_test.go:
##########
@@ -224,14 +224,14 @@ func newAllocationAskAll(allocKey, appID, taskGroup string, res *resources.Resou
 	return NewAllocationAskFromSI(ask)
 }
 
-func getTestUserGroup() security.UserGroup {
-	return security.UserGroup{User: "testuser", Groups: []string{"testgroup"}}
+func getTestUserGroup(userName string, groupNameList []string) security.UserGroup {

Review Comment:
   Addressed in latest PR.



-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [yunikorn-core] zhuqi-lucas commented on pull request #472: [YUNIKORN-1428] Add unit tests to ensure multiple users belongs to single group and vice versa cases

Posted by GitBox <gi...@apache.org>.
zhuqi-lucas commented on PR #472:
URL: https://github.com/apache/yunikorn-core/pull/472#issuecomment-1349041061

   Thank you @wilfred-s for review, addressed comments in latest PR.


-- 
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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org