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 2019/05/01 22:49:01 UTC

[GitHub] [trafficcontrol] dangogh opened a new issue #3539: lib/go-tc -- nullable vs non-nullable structs different

dangogh opened a new issue #3539: lib/go-tc -- nullable vs non-nullable structs different
URL: https://github.com/apache/trafficcontrol/issues/3539
 
 
   I wrote a test a while ago that compares nullable structs vs non-nullable using reflection.  The test is not run by default yet (protected by `nullable` tag),  but running it manually reveals a number of inconsistencies that should be fixed.   Note that one line must be removed from the test because the struct it compares (DeliveryServiceV12) had been removed:
   
   ```
   $ cd lib/go-tc; go test -tags nullable
   --- FAIL: TestNullStructs (0.00s)
       nullable_test.go:96: tc.ASN.LastUpdated (string) and tc.ASNNullable.LastUpdated (*tc.TimeNoMod) have mismatched types
       nullable_test.go:71: tc.DeliveryService has 3 fields, but tc.DeliveryServiceNullable has 4
       nullable_test.go:112: field ConsistentHashRegex found on tc.DeliveryService but not tc.DeliveryServiceNullable
       nullable_test.go:71: tc.DeliveryServiceV11 has 54 fields, but tc.DeliveryServiceNullableV11 has 56
       nullable_test.go:84: field DeepCachingType found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:84: field DNSBypassCname found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:96: tc.DeliveryServiceV11.InitialDispersion (float32) and tc.DeliveryServiceNullableV11.InitialDispersion (*int) have mismatched types
       nullable_test.go:84: field TRResponseHeaders found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:112: field DNSBypassCNAME found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:112: field GeoLimitCountries found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:112: field GeoLimitRedirectURL found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:112: field OriginShield found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:112: field SSLKeyVersion found on tc.DeliveryServiceV11 but not tc.DeliveryServiceNullableV11
       nullable_test.go:71: tc.Profile has 10 fields, but tc.ProfileNullable has 9
       nullable_test.go:84: field Parameter found on tc.Profile but not tc.ProfileNullable
       nullable_test.go:96: tc.SteeringTarget.DeliveryServiceID (int) and tc.SteeringTargetNullable.DeliveryServiceID (*uint64) have mismatched types
       nullable_test.go:96: tc.SteeringTarget.TargetID (int) and tc.SteeringTargetNullable.TargetID (*uint64) have mismatched types
   FAIL
   exit status 1
   FAIL	github.com/apache/trafficcontrol/lib/go-tc	0.027s

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


With regards,
Apache Git Services