TESTING: Don't skip other tests when test failed (#2252)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
imlonghao 2023-04-02 20:42:10 +08:00 committed by GitHub
parent 2a28d81490
commit 8d79ee072f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -286,11 +286,18 @@ func runTests(t *testing.T, prv providers.DNSServiceProvider, domainName string,
for _, tst := range group.tests { for _, tst := range group.tests {
makeChanges(t, prv, dc, tst, fmt.Sprintf("%02d:%s", gIdx, group.Desc), true, origConfig) // TODO(tlim): This is the old version. It skipped the remaining tc() statements if one failed.
// The new code continues to test the remaining tc() statements. Keeping this as a comment
if t.Failed() { // in case we ever want to do something similar.
// https://github.com/StackExchange/dnscontrol/pull/2252#issuecomment-1492204409
// makeChanges(t, prv, dc, tst, fmt.Sprintf("%02d:%s", gIdx, group.Desc), true, origConfig)
// if t.Failed() {
// break
// }
if ok := makeChanges(t, prv, dc, tst, fmt.Sprintf("%02d:%s", gIdx, group.Desc), true, origConfig); !ok {
break break
} }
} }
// Remove all records so next group starts with a clean slate. // Remove all records so next group starts with a clean slate.