From 8df943f8298b6d3e45e6f01cc8f404efff8c109d Mon Sep 17 00:00:00 2001 From: Muneeb Ullah Khan <100969065+MuneebUllahKhan222@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:13:41 +0500 Subject: [PATCH] [INS-331] Fix the issue causing the tests file system soruce tests to fail on windows (#4743) * fix excludepaths flag causing the test to fail * fixed bugbot comms --- pkg/sources/filesystem/filesystem_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/sources/filesystem/filesystem_test.go b/pkg/sources/filesystem/filesystem_test.go index 151cada66..07803ca72 100644 --- a/pkg/sources/filesystem/filesystem_test.go +++ b/pkg/sources/filesystem/filesystem_test.go @@ -347,7 +347,8 @@ func TestSkipDir(t *testing.T) { defer cleanupDir() // create an ExcludePathsFile that contains the ignoreDir path - excludeFile, cleanupFile, err := createTempFile("", ignoreDir+"\n") + // In windows path contains \ so we escape it by replacing it with \\ in ignoreDir + excludeFile, cleanupFile, err := createTempFile("", strings.ReplaceAll(ignoreDir, `\`, `\\`)+"\n") require.NoError(t, err) defer cleanupFile() @@ -392,8 +393,8 @@ func TestScanSubDirFile(t *testing.T) { // Create an IncludePathsFile with the absolute path of the file includeFilePath := filepath.Join(testDir, "include.txt") - err = os.WriteFile(includeFilePath, []byte(filePath+"\n"), 0644) - require.NoError(t, err) + err = os.WriteFile(includeFilePath, []byte(strings.ReplaceAll(filePath, `\`, `\\`)+"\n"), 0644) + require.NoError(t, err) conn, err := anypb.New(&sourcespb.Filesystem{ IncludePathsFile: includeFilePath,