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
This commit is contained in:
Roo Code 2025-07-18 16:25:06 +00:00
parent b2e96eb3d6
commit cb0e900d6c

View file

@ -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$/)
})
})