test: normalize paths in OPENCLAW_HOME tests for cross-platform support#12212
Merged
quotentiroler merged 4 commits intomainfrom Feb 9, 2026
Merged
test: normalize paths in OPENCLAW_HOME tests for cross-platform support#12212quotentiroler merged 4 commits intomainfrom
quotentiroler merged 4 commits intomainfrom
Conversation
Comment on lines
219
to
223
| it("uses OPENCLAW_HOME for default agentDir", () => { | ||
| const home = path.join(path.sep, "srv", "openclaw-home"); | ||
| vi.stubEnv("OPENCLAW_HOME", home); | ||
| // Clear state dir so it falls back to OPENCLAW_HOME | ||
| vi.stubEnv("OPENCLAW_STATE_DIR", ""); |
Contributor
There was a problem hiding this comment.
Env override may not clear
vi.stubEnv("OPENCLAW_STATE_DIR", "") relies on the production code treating an empty string the same as “unset”. If resolveAgentDir checks process.env.OPENCLAW_STATE_DIR !== undefined (common pattern), this will still be considered set and the test will fail (or worse, pass for the wrong reason if empty string leads to odd path joins). Consider deleting the var (or restoring previous value) instead of setting it to "", so the fallback to OPENCLAW_HOME is unambiguous on all platforms.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/agent-scope.test.ts
Line: 219:223
Comment:
**Env override may not clear**
`vi.stubEnv("OPENCLAW_STATE_DIR", "")` relies on the production code treating an *empty string* the same as “unset”. If `resolveAgentDir` checks `process.env.OPENCLAW_STATE_DIR !== undefined` (common pattern), this will still be considered set and the test will fail (or worse, pass for the wrong reason if empty string leads to odd path joins). Consider deleting the var (or restoring previous value) instead of setting it to `""`, so the fallback to `OPENCLAW_HOME` is unambiguous on all platforms.
How can I resolve this? If you propose a fix, please make it concise.eef1216 to
c728f06
Compare
zendizmo
pushed a commit
to zendizmo/openclaw
that referenced
this pull request
Feb 9, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
yeboster
pushed a commit
to yeboster/openclaw
that referenced
this pull request
Feb 9, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
NikolasP98
pushed a commit
to NikolasP98/openclaw
that referenced
this pull request
Feb 9, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
NikolasP98
added a commit
to NikolasP98/openclaw
that referenced
this pull request
Feb 9, 2026
Integrated upstream improvements: - CRITICAL: Fix bundled hooks broken since 2026.2.2 (openclaw#9295) - Grok web search provider (xAI) with inline citations - Telegram video note support with tests and docs - QMD model cache sharing optimization (openclaw#12114) - Context overflow false positive fix (openclaw#2078) - Model failover 400 status handling (openclaw#1879) - Dynamic config loading per-message (openclaw#11372) - Gateway post-compaction amnesia fix (openclaw#12283) - Skills watcher: ignore Python venvs and caches - Telegram send recovery from stale thread IDs - Cron job parameter recovery (openclaw#12124) - Auto-reply weekday timestamps (openclaw#12438) - Utility consolidation refactoring (PNG, JSON, errors) - Cross-platform test normalization (openclaw#12212) - macOS Nix defaults support (openclaw#12205) Preserved DEV enhancements: - Docker multi-stage build with enhanced tooling (gh, gog, obsidian-cli, uv, nano-pdf, mcporter, qmd) - Comprehensive .env.example documentation (371 lines) - Multi-environment docker-compose support (DEV/PRD) - GOG/Tailscale integration - Fork-sync and openclaw-docs skills - UI config editor (Svelte) - Fork workflow documentation Merge strategy: Cherry-picked 22 upstream commits, preserved DEV Docker architecture. Docker files unchanged: Dockerfile, docker-compose.yml, docker-setup.sh, .env.example Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Ethermious
pushed a commit
to Ethermious/openclaw
that referenced
this pull request
Feb 9, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
lucasmpramos
pushed a commit
to butley/openclaw
that referenced
this pull request
Feb 10, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
yeboster
pushed a commit
to yeboster/openclaw
that referenced
this pull request
Feb 13, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
skyhawk14
pushed a commit
to skyhawk14/openclaw
that referenced
this pull request
Feb 13, 2026
…rt (openclaw#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
mbelinky
pushed a commit
that referenced
this pull request
Feb 14, 2026
…rt (#12212) * test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Windows CI test failures caused by Unix-style path literals (e.g.,
/srv/openclaw-home) in tests. Instead of skipping tests on Windows, normalize paths usingpath.join(path.sep, ...)for cross-platform compatibility.Tests now also account for
path.resolve()behavior from #12125.Changes
src/agents/agent-scope.test.ts/srv/openclaw-homepaths withpath.join(path.sep, "srv", "openclaw-home")OPENCLAW_STATE_DIRto ensureOPENCLAW_HOMEfallback is properly testedpath.resolve(home)in expectations for cross-platform compatibilitysrc/agents/workspace.defaults.test.tspath.resolve()src/config/config.nix-integration-u3-u5-u9.test.ts/custom/homepaths to usepath.join(path.sep, ...)path.resolve()in expectations to match production behaviorsrc/agents/pi-embedded-runner.test.tsitIfNotWin32skip - test runs fine on WindowsType of change
Testing
pnpm vitest run src/agents/agent-scope.test.ts- all 10 tests passpnpm vitest run src/agents/workspace.defaults.test.ts- all 1 test passespnpm vitest run src/config/config.nix-integration-u3-u5-u9.test.ts- all 19 tests passpnpm vitest run src/agents/pi-embedded-runner.test.ts- all 9 tests passpnpm checkpassesFixes Windows CI failures from #11881.