Skip to content

Commit b0198c8

Browse files
committed
test(registry): enhance logging for empty targets in TXT records test
1 parent 4ef055b commit b0198c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

registry/txt_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ import (
2626
"github.com/stretchr/testify/assert"
2727
"github.com/stretchr/testify/require"
2828

29+
log "github.com/sirupsen/logrus"
30+
2931
"sigs.k8s.io/external-dns/endpoint"
3032
"sigs.k8s.io/external-dns/internal/testutils"
3133
"sigs.k8s.io/external-dns/plan"
@@ -1819,6 +1821,7 @@ func TestTXTRegistryRecordsWithEmptyTargets(t *testing.T) {
18191821
})
18201822

18211823
r, _ := NewTXTRegistry(p, "", "", "owner", time.Hour, "", []string{}, []string{}, false, nil, false)
1824+
b := testutils.LogsToBuffer(log.ErrorLevel, t)
18221825
records, err := r.Records(ctx)
18231826
require.NoError(t, err)
18241827

@@ -1832,4 +1835,5 @@ func TestTXTRegistryRecordsWithEmptyTargets(t *testing.T) {
18321835
}
18331836

18341837
assert.True(t, testutils.SameEndpoints(records, expectedRecords))
1838+
assert.Contains(t, b.String(), "TXT record has no targets empty-targets.test-zone.example.org")
18351839
}

0 commit comments

Comments
 (0)