ocket8888 commented on a change in pull request #4196: TP: Provides the ability 
to view all users for a given role
URL: https://github.com/apache/trafficcontrol/pull/4196#discussion_r376015818
 
 

 ##########
 File path: traffic_ops/testing/api/v1/user_test.go
 ##########
 @@ -296,8 +296,8 @@ func GetTestUsers(t *testing.T) {
 
 func GetTestAdminUsers(t *testing.T) {
        adminUsers, _, err := TOSession.GetUsersByRole("admin")
-       if err != nil {
-               t.Errorf("cannot GET users by role: %v", err)
+       if err != nil || len(adminUsers) == 0 || adminUsers[0].RoleName == nil {
 
 Review comment:
   If this test errors because `adminUsers` is `nil`/empty or its first 
member's `RoleName` property is `nil` then it'll print `cannot GET admin users 
by role: <nil>` which isn't super helpful. But what's worse is that in that 
case the test continues because it's only an error, not a fatal one. So it 
would still segfault.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to