zrhoffman commented on a change in pull request #5071:
URL: https://github.com/apache/trafficcontrol/pull/5071#discussion_r501150919
##########
File path: traffic_ops/testing/api/v3/deliveryservice_requests_test.go
##########
@@ -209,29 +405,43 @@ func TestDeliveryServiceRequestWorkflow(t *testing.T) {
}
alerts, dsr := updateDeliveryServiceRequestStatus(t, dsrs[0],
"submitted")
+ found = false
+ for _, alert := range alerts.Alerts {
+ if alert.Level == tc.ErrorLevel.String() {
+ t.Errorf("Unexpected error-level alert: %s",
alert.Text)
+ } else if alert.Level == tc.SuccessLevel.String() &&
strings.Contains(alert.Text, "updated") {
+ found = true
+ }
+ }
- expected = []string{
- "deliveryservice_request was updated.",
+ if !found {
+ t.Error("Didn't find success-level alert after
updating")
}
- utils.Compare(t, expected, alerts.ToStrings())
if dsr.Status != tc.RequestStatus("submitted") {
t.Errorf("expected status=submitted, got %s",
string(dsr.Status))
}
})
}
-func updateDeliveryServiceRequestStatus(t *testing.T, dsr
tc.DeliveryServiceRequest, newstate string) (tc.Alerts,
tc.DeliveryServiceRequest) {
- ID := dsr.ID
+func updateDeliveryServiceRequestStatus(t *testing.T, dsr
tc.DeliveryServiceRequestV30, newstate string) (tc.Alerts,
tc.DeliveryServiceRequestV30) {
+ if dsr.ID == nil {
+ t.Error("Cannot update DSR with no ID")
Review comment:
Good point, that sounds fine to me
----------------------------------------------------------------
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]