After successfully creating, retrieving, and deleting a domain, the test fails:
• Failure [2.573 seconds]
SoftLayer DNS domains
/Users/sykesm/workspace/softlayer-go/src/github.com/maximilien/softlayer-go/integration/dns_domain/dns_domain_test.go:45
SoftLayer_Dns_Domain
/Users/sykesm/workspace/softlayer-go/src/github.com/maximilien/softlayer-go/integration/dns_domain/dns_domain_test.go:44
creates a DNS Domain, update it, and delete it [It]
/Users/sykesm/workspace/softlayer-go/src/github.com/maximilien/softlayer-go/integration/dns_domain/dns_domain_test.go:43
Expected error:
<*errors.errorString | 0xc82030a190>: {
s: "softlayer-go: could not SoftLayer_Dns_Domain#getObject, HTTP error code: '404'",
}
softlayer-go: could not SoftLayer_Dns_Domain#getObject, HTTP error code: '404'
not to have occurred
/Users/sykesm/workspace/softlayer-go/src/github.com/maximilien/softlayer-go/test_helpers/test_helpers.go:746
------------------------------
Summarizing 1 Failure:
[Fail] SoftLayer DNS domains SoftLayer_Dns_Domain [It] creates a DNS Domain, update it, and delete it
/Users/sykesm/workspace/softlayer-go/src/github.com/maximilien/softlayer-go/test_helpers/test_helpers.go:746
Ran 1 of 1 Specs in 2.591 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped
Looks like WaitForDeletedDnsDomainToNoLongerBePresent fails because, after deletion, the domain can't be retrieved and the production code turns the 404 into an error.
func WaitForDeletedDnsDomainToNoLongerBePresent(dnsDomainId int) {
dnsDomainService, err := CreateDnsDomainService()
Expect(err).ToNot(HaveOccurred())
fmt.Printf("----> waiting for deleted dns domain to no longer be present\n")
Eventually(func() bool {
dnsDomain, err := dnsDomainService.GetObject(dnsDomainId)
Expect(err).ToNot(HaveOccurred())
if dnsDomain.Id == dnsDomainId {
return false
}
return true
}, TIMEOUT, POLLING_INTERVAL).Should(BeTrue(), "failed waiting for deleted dns domain to be removed")
}
I'm not sure how this ever worked.
Also, for logging in tests, you should consider using GinkgoWriter as described in the doc instead of fmt.Printf.
After successfully creating, retrieving, and deleting a domain, the test fails:
Looks like
WaitForDeletedDnsDomainToNoLongerBePresent
fails because, after deletion, the domain can't be retrieved and the production code turns the 404 into an error.I'm not sure how this ever worked.
Also, for logging in tests, you should consider using
GinkgoWriter
as described in the doc instead offmt.Printf
.