From a86e5058952086ee3b9c1501fc25f6e2d740eafc Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Wed, 10 Apr 2024 15:49:05 -0700 Subject: [PATCH] [pkg/stanza] Fix tests on Windows (#32305) Fix tests failing in https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8637187949/job/23678820573 Resolves https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/32299 --- .../fileconsumer/matcher/matcher_test.go | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/stanza/fileconsumer/matcher/matcher_test.go b/pkg/stanza/fileconsumer/matcher/matcher_test.go index ab9d0cd97063..759ca8a7275f 100644 --- a/pkg/stanza/fileconsumer/matcher/matcher_test.go +++ b/pkg/stanza/fileconsumer/matcher/matcher_test.go @@ -715,35 +715,35 @@ func TestMatcher(t *testing.T) { { name: "Recursive match - include", files: []string{ - "a/1.log", - "a/2.log", - "a/b/1.log", - "a/b/2.log", - "a/b/c/1.log", - "a/b/c/2.log", - }, - include: []string{"**/1.log"}, + filepath.Join("a", "1.log"), + filepath.Join("a", "2.log"), + filepath.Join("a", "b", "1.log"), + filepath.Join("a", "b", "2.log"), + filepath.Join("a", "b", "c", "1.log"), + filepath.Join("a", "b", "c", "2.log"), + }, + include: []string{filepath.Join("**", "1.log")}, exclude: []string{}, expected: []string{ - "a/1.log", - "a/b/1.log", - "a/b/c/1.log", + filepath.Join("a", "1.log"), + filepath.Join("a", "b", "1.log"), + filepath.Join("a", "b", "c", "1.log"), }, }, { name: "Recursive match - include and exclude", files: []string{ - "a/1.log", - "a/2.log", - "a/b/1.log", - "a/b/2.log", - "a/b/c/1.log", - "a/b/c/2.log", - }, - include: []string{"**/1.log"}, - exclude: []string{"**/b/**/1.log"}, + filepath.Join("a", "1.log"), + filepath.Join("a", "2.log"), + filepath.Join("a", "b", "1.log"), + filepath.Join("a", "b", "2.log"), + filepath.Join("a", "b", "c", "1.log"), + filepath.Join("a", "b", "c", "2.log"), + }, + include: []string{filepath.Join("**", "1.log")}, + exclude: []string{filepath.Join("**", "b", "**", "1.log")}, expected: []string{ - "a/1.log", + filepath.Join("a", "1.log"), }, }}