diff --git a/source/wrappers/multisource_test.go b/source/wrappers/multisource_test.go index ea45093f8d..8e3d3b9e41 100644 --- a/source/wrappers/multisource_test.go +++ b/source/wrappers/multisource_test.go @@ -45,9 +45,6 @@ func testMultiSourceImplementsSource(t *testing.T) { // testMultiSourceEndpoints tests merged endpoints from children are returned. func testMultiSourceEndpoints(t *testing.T) { - foo := &endpoint.Endpoint{DNSName: "foo", Targets: endpoint.Targets{"8.8.8.8"}} - bar := &endpoint.Endpoint{DNSName: "bar", Targets: endpoint.Targets{"8.8.4.4"}} - for _, tc := range []struct { title string nestedEndpoints [][]*endpoint.Endpoint @@ -65,19 +62,26 @@ func testMultiSourceEndpoints(t *testing.T) { }, { "single non-empty child source returns child's endpoints", - [][]*endpoint.Endpoint{{foo}}, - []*endpoint.Endpoint{foo}, + [][]*endpoint.Endpoint{ + {&endpoint.Endpoint{DNSName: "foo", Targets: endpoint.Targets{"8.8.8.8"}}}, + }, + []*endpoint.Endpoint{ + {DNSName: "foo", Targets: endpoint.Targets{"8.8.8.8"}}, + }, }, { "multiple non-empty child sources returns merged children's endpoints", - [][]*endpoint.Endpoint{{foo}, {bar}}, - []*endpoint.Endpoint{foo, bar}, + [][]*endpoint.Endpoint{{ + &endpoint.Endpoint{DNSName: "foo", Targets: endpoint.Targets{"8.8.8.8"}}, + }, { + &endpoint.Endpoint{DNSName: "bar", Targets: endpoint.Targets{"8.8.4.4"}}}}, + []*endpoint.Endpoint{ + {DNSName: "foo", Targets: endpoint.Targets{"8.8.8.8"}}, + {DNSName: "bar", Targets: endpoint.Targets{"8.8.4.4"}}}, }, } { t.Run(tc.title, func(t *testing.T) { - t.Parallel() - // Prepare the nested mock sources. sources := make([]source.Source, 0, len(tc.nestedEndpoints)) diff --git a/source/wrappers/targetfiltersource_test.go b/source/wrappers/targetfiltersource_test.go index 7298c1e0ac..b958579eb6 100644 --- a/source/wrappers/targetfiltersource_test.go +++ b/source/wrappers/targetfiltersource_test.go @@ -70,13 +70,6 @@ func TestEchoSourceReturnGivenSources(t *testing.T) { } } -func TestTargetFilterSource(t *testing.T) { - t.Parallel() - - t.Run("Interface", TestTargetFilterSourceImplementsSource) - t.Run("Endpoints", TestTargetFilterSourceEndpoints) -} - // TestTargetFilterSourceImplementsSource tests that targetFilterSource is a valid Source. func TestTargetFilterSourceImplementsSource(t *testing.T) { var _ source.Source = &targetFilterSource{} @@ -120,10 +113,7 @@ func TestTargetFilterSourceEndpoints(t *testing.T) { }, } for _, tt := range tests { - t.Run(tt.title, func(t *testing.T) { - t.Parallel() - echo := testutils.NewMockSource(tt.endpoints...) src := NewTargetFilterSource(echo, tt.filters)