You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/10/07 16:07:17 UTC
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5071: Delivery Service Request Overhaul
ocket8888 commented on a change in pull request #5071:
URL: https://github.com/apache/trafficcontrol/pull/5071#discussion_r501134481
##########
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:
Why not?
----------------------------------------------------------------
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:
users@infra.apache.org