ocket8888 commented on a change in pull request #5512:
URL: https://github.com/apache/trafficcontrol/pull/5512#discussion_r608769136



##########
File path: traffic_ops/testing/api/v4/cachegroups_test.go
##########
@@ -455,22 +510,33 @@ func UpdateTestCacheGroups(t *testing.T) {
                t.Fatal("got an empty response for cachegroups")
        }
        cg = resp[0]
-       if !reflect.DeepEqual(expectedFallbacks, *cg.Fallbacks) {
+       if cg.Fallbacks == nil {
+               t.Error("Cache Group returned by Traffic Ops had null or 
undefined fallbacks")
+       } else if !reflect.DeepEqual(expectedFallbacks, *cg.Fallbacks) {
                t.Errorf("failed to update fallbacks (expected = %v, actual = 
%v)", expectedFallbacks, *cg.Fallbacks)
        }
+       if cg.ID == nil {
+               t.Fatal("Cache Group returned by Traffic Ops had null or 
undefined ID")
+       }
 
        const topologyEdgeCGName = "topology-edge-cg-01"
-       resp, _, err = 
TOSession.GetCacheGroupNullableByNameWithHdr(topologyEdgeCGName, nil)
+       resp, _, err = TOSession.GetCacheGroupByName(topologyEdgeCGName, nil)
        if err != nil {
-               t.Errorf("cannot GET CacheGroup by name: '$%s', %v", 
topologyEdgeCGName, err)
+               t.Fatalf("cannot GET CacheGroup by name: '$%s', %v", 
topologyEdgeCGName, err)
        }
        if len(resp) == 0 {
                t.Fatal("got an empty response for cachegroups")
        }
        cg = resp[0]
+       if cg.TypeID == nil {
+               t.Error("Cache Group returned by Traffic Ops had null or 
undefined typeId")

Review comment:
       Yes, that should've been fatal




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


Reply via email to