Skip to content

Commit cb0e900

Browse files
committed
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
1 parent b2e96eb commit cb0e900

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/services/code-index/vector-store/__tests__/qdrant-client.spec.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ describe("QdrantVectorStore", () => {
15831583
{
15841584
key: "filePath",
15851585
match: {
1586-
value: expect.stringContaining("src/test.ts"),
1586+
value: expect.stringMatching(/.*[\/\\]src[\/\\]test\.ts$/),
15871587
},
15881588
},
15891589
],
@@ -1605,19 +1605,19 @@ describe("QdrantVectorStore", () => {
16051605
{
16061606
key: "filePath",
16071607
match: {
1608-
value: expect.stringContaining("src/test1.ts"),
1608+
value: expect.stringMatching(/.*[\/\\]src[\/\\]test1\.ts$/),
16091609
},
16101610
},
16111611
{
16121612
key: "filePath",
16131613
match: {
1614-
value: expect.stringContaining("src/test2.ts"),
1614+
value: expect.stringMatching(/.*[\/\\]src[\/\\]test2\.ts$/),
16151615
},
16161616
},
16171617
{
16181618
key: "filePath",
16191619
match: {
1620-
value: expect.stringContaining("src/test3.ts"),
1620+
value: expect.stringMatching(/.*[\/\\]src[\/\\]test3\.ts$/),
16211621
},
16221622
},
16231623
]),
@@ -1751,7 +1751,8 @@ describe("QdrantVectorStore", () => {
17511751
// Both paths should be normalized to absolute paths
17521752
expect(deleteCall.filter.should).toHaveLength(2)
17531753
deleteCall.filter.should.forEach((filter: any) => {
1754-
expect(filter.match.value).toMatch(/^\/.*\/src\/test.*\.ts$/) // Should be absolute paths
1754+
// Should be absolute paths - either Unix style (/path) or Windows style (C:\path)
1755+
expect(filter.match.value).toMatch(/^([a-zA-Z]:[\/\\]|[\/\\]).*[\/\\]src[\/\\]test.*\.ts$/)
17551756
})
17561757
})
17571758

0 commit comments

Comments
 (0)