Skip to content

fix(test): use path.sep in qmd-manager XDG assertions for Windows compat#23128

Closed
dashed wants to merge 1 commit intoopenclaw:mainfrom
dashed:alberto/qmd-manager-windows-path
Closed

fix(test): use path.sep in qmd-manager XDG assertions for Windows compat#23128
dashed wants to merge 1 commit intoopenclaw:mainfrom
dashed:alberto/qmd-manager-windows-path

Conversation

@dashed
Copy link
Contributor

@dashed dashed commented Feb 22, 2026

Summary

Fixes the Windows CI failure in src/memory/qmd-manager.test.ts introduced by #19617 (commit 3317b49).

The test "passes manager-scoped XDG env to mcporter commands" asserts toContain("/agents/main/qmd/xdg-config") with hardcoded Unix forward slashes. On Windows, path.join produces backslash-separated paths (\agents\main\qmd\xdg-config), so the assertion fails.

Root Cause

The source code (qmd-manager.ts:145) correctly uses path.join(this.qmdDir, "xdg-config"), which produces OS-native separators. The test assertion at line 988 uses a hardcoded forward-slash string that doesn't match on Windows.

Changes

src/memory/qmd-manager.test.ts — Use path.sep for cross-platform assertions:

-    expect(spawnOpts?.env?.XDG_CONFIG_HOME).toContain("/agents/main/qmd/xdg-config");
-    expect(spawnOpts?.env?.XDG_CACHE_HOME).toContain("/agents/main/qmd/xdg-cache");
+    expect(spawnOpts?.env?.XDG_CONFIG_HOME).toContain(
+      ["agents", "main", "qmd", "xdg-config"].join(path.sep),
+    );
+    expect(spawnOpts?.env?.XDG_CACHE_HOME).toContain(
+      ["agents", "main", "qmd", "xdg-cache"].join(path.sep),
+    );

path is already imported in the test file. path.sep is / on Unix and \ on Windows, matching the output of path.join used in the source.

Impact

  • main branch CI: The checks-windows (node, test) job is currently failing on main (run 22268115588)
  • All open PRs: Any PR merging with current main inherits this failure

Greptile Summary

Fixed Windows test failure by using path.sep in XDG path assertions. The test now correctly matches OS-native path separators produced by path.join in the source code (qmd-manager.ts:149-150).

  • Replaced hardcoded Unix forward slashes with ["agents", "main", "qmd", "xdg-config"].join(path.sep)
  • Applied same fix to both XDG_CONFIG_HOME and XDG_CACHE_HOME assertions
  • path module already imported; no additional dependencies needed

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The fix is a minimal, surgical change that correctly addresses a cross-platform path separator issue. The solution uses standard Node.js path.sep to match the behavior of path.join in the source code, making the test assertions platform-agnostic. No logic changes, no security implications, and the fix directly resolves the failing Windows CI
  • No files require special attention

Last reviewed commit: 36cbae4

@dashed dashed force-pushed the alberto/qmd-manager-windows-path branch from 36cbae4 to e52609c Compare February 22, 2026 04:08
@dashed
Copy link
Contributor Author

dashed commented Feb 22, 2026

Closing — upstream main already includes a fix for this same issue (using a normalizePath helper approach). After rebasing this branch onto current main, the diff became empty, confirming the fix is already present.

@dashed dashed closed this Feb 22, 2026
@dashed dashed deleted the alberto/qmd-manager-windows-path branch February 22, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant