SP12893678 commented on PR #885: URL: https://github.com/apache/yunikorn-core/pull/885#issuecomment-2150556908
> Both `setUsers()` and `setGroups()` are called from `NewACL()`, so there's no need to test them separately. Make sure that we have coverage though and instead of adding new test, extend `TestACLCreate()`. > > As I can see, we miss three cases: > > * `setUsers()`: when `if len(userList) == 0` true > * `setUsers()`: when `if userNameRegExp.MatchString(user)` false > * `setGroups()`: when if `len(groupList) == 0` true Yes, I initially expected to increase the coverage by expanding the TestACLCreate test case. However, due to strings.Split, which results in an array with a length of at least 1, the following two scenarios are unreachable. - `setUsers()`: when `if len(userList) == 0` true - `setGroups()`: when if `len(groupList) == 0` true In fact, in a separate function, this condition is still necessary. -- 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]
