dewrich closed pull request #1948: sort errors in asn/cdn tests
URL: https://github.com/apache/incubator-trafficcontrol/pull/1948
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/traffic_ops/traffic_ops_golang/asn/asns_test.go
b/traffic_ops/traffic_ops_golang/asn/asns_test.go
index b1d0bb4b42..dcb0a3b7ea 100644
--- a/traffic_ops/traffic_ops_golang/asn/asns_test.go
+++ b/traffic_ops/traffic_ops_golang/asn/asns_test.go
@@ -114,7 +114,7 @@ func TestValidate(t *testing.T) {
i := -99
asn := TOASN{ASN: &i, CachegroupID: &i}
- errs := asn.Validate(nil)
+ errs := test.SortErrors(asn.Validate(nil))
expected := []error{
errors.New(`'asn' must be no less than 0`),
errors.New(`'cachegroupId' must be no less than 0`),
diff --git a/traffic_ops/traffic_ops_golang/cdn/cdns_test.go
b/traffic_ops/traffic_ops_golang/cdn/cdns_test.go
index 65b676fe7f..c514efeb4a 100644
--- a/traffic_ops/traffic_ops_golang/cdn/cdns_test.go
+++ b/traffic_ops/traffic_ops_golang/cdn/cdns_test.go
@@ -132,11 +132,11 @@ func TestValidate(t *testing.T) {
// invalid name, empty domainname
n := "not_a_valid_cdn"
c := TOCDN{Name: &n}
- errs := c.Validate(nil)
+ errs := test.SortErrors(c.Validate(nil))
expectedErrs := []error{
- errors.New(`'name' invalid characters found - Use alphanumeric
. or - .`),
errors.New(`'domainName' cannot be blank`),
+ errors.New(`'name' invalid characters found - Use alphanumeric
. or - .`),
}
if !reflect.DeepEqual(expectedErrs, errs) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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