From cb0e900d6c287426a10d0afd9704007128812abb Mon Sep 17 00:00:00 2001 From: Roo Code Date: Fri, 18 Jul 2025 16:25:06 +0000 Subject: [PATCH] fix: make qdrant-client tests cross-platform compatible - Updated path expectations in deletePointsByMultipleFilePaths tests to handle both Unix and Windows path formats - Changed stringContaining() to stringMatching() with regex patterns that accept both / and \ path separators - Fixed absolute path regex to handle both Unix (/path) and Windows (C:\path) formats - Resolves Windows platform-unit-test failures in CI --- .../vector-store/__tests__/qdrant-client.spec.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts b/src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts index c44ee76a8a..78b1c587e9 100644 --- a/src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts +++ b/src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts @@ -1583,7 +1583,7 @@ describe("QdrantVectorStore", () => { { key: "filePath", match: { - value: expect.stringContaining("src/test.ts"), + value: expect.stringMatching(/.*[\/\\]src[\/\\]test\.ts$/), }, }, ], @@ -1605,19 +1605,19 @@ describe("QdrantVectorStore", () => { { key: "filePath", match: { - value: expect.stringContaining("src/test1.ts"), + value: expect.stringMatching(/.*[\/\\]src[\/\\]test1\.ts$/), }, }, { key: "filePath", match: { - value: expect.stringContaining("src/test2.ts"), + value: expect.stringMatching(/.*[\/\\]src[\/\\]test2\.ts$/), }, }, { key: "filePath", match: { - value: expect.stringContaining("src/test3.ts"), + value: expect.stringMatching(/.*[\/\\]src[\/\\]test3\.ts$/), }, }, ]), @@ -1751,7 +1751,8 @@ describe("QdrantVectorStore", () => { // Both paths should be normalized to absolute paths expect(deleteCall.filter.should).toHaveLength(2) deleteCall.filter.should.forEach((filter: any) => { - expect(filter.match.value).toMatch(/^\/.*\/src\/test.*\.ts$/) // Should be absolute paths + // Should be absolute paths - either Unix style (/path) or Windows style (C:\path) + expect(filter.match.value).toMatch(/^([a-zA-Z]:[\/\\]|[\/\\]).*[\/\\]src[\/\\]test.*\.ts$/) }) })