agent-orchestrator/packages/cli/__tests__/lib
Priyanshu Choudhary d16d3c3f4d test(windows): isolate USERPROFILE per test, normalize path assertions
Before this, vitest worker isolation only overrode HOME, but on Windows
os.homedir() reads USERPROFILE. Tests that wrote to ~/.agent-orchestrator
ended up sharing the real user's data directory across workers, leading
to flaky cross-test pollution.

- test-utils: createTestEnvironment / setupTestContext now override both
  HOME and USERPROFILE to the per-test fake home, restore both on
  teardown. rmSync uses maxRetries:5/retryDelay:50 to ride out the same
  Windows file-lock window that atomic-write retries cover.
- core test files (global-config, plugin-integration, portfolio-*,
  project-resolver, recovery-actions, orchestrator-prompt*): set fake
  USERPROFILE alongside HOME and use the retry-aware rmSync.
- update-check.test: normalize path separators in assertions
  (path.replace(/\/g, "/")) so script-path matching works on Windows
  without forcing the production code to emit posix paths.
- orchestrator-prompt.dist.test: pass shell:true on Windows to execFileSync
  for .cmd targets, working around Node CVE-2024-27980's hardening.

Removed lifecycle-service.test.ts — it covered stopLifecycleWorker, which
was deleted when lifecycle was moved in-process during the merge with
main. The remaining lifecycle paths are exercised by lifecycle-manager
tests in core.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 11:25:34 +05:30
..
detect-env.test.ts refactor(cli): extract shared repo helpers and support GitLab subgroups 2026-04-15 12:30:32 +05:30
format.test.ts feat: implement CLI with all commands (init, status, spawn, session, send, review-check, dashboard, open) (#6) 2026-02-14 16:14:27 +05:30
lifecycle-service.test.ts refactor(cli): remove lifecycle-worker subprocess, poll in-process (#1186) 2026-04-14 17:23:33 +05:30
openclaw-probe.test.ts fix(windows): address review feedback, fix tests, and improve Windows coverage 2026-04-11 14:48:25 +05:30
plugins.test.ts Reapply "Merge branch 'main' into feat/windows-platform-adapter" 2026-04-10 02:06:19 +05:30
preflight.test.ts Reapply "Merge branch 'main' into feat/windows-platform-adapter" 2026-04-10 02:06:19 +05:30
prevent-sleep.test.ts fix(power): address PR review feedback for sleep prevention 2026-04-11 21:06:32 +05:30
project-resolution.test.ts fix: detect nested project directories in CLI auto-resolution 2026-04-01 18:28:57 +05:30
repo-validation.test.ts refactor(cli): extract shared repo helpers and support GitLab subgroups 2026-04-15 12:30:32 +05:30
running-state.test.ts fix: tighten startup lock cleanup 2026-04-20 13:30:07 +05:30
script-runner.test.ts fix(windows): update @composio imports to @aoagents scope 2026-04-10 02:28:12 +05:30
session-utils.test.ts Add multi-project storage, resolution, and project settings support (#1343) 2026-04-21 17:45:55 +05:30
shell.test.ts fix(windows): update @composio imports to @aoagents scope 2026-04-10 02:28:12 +05:30
update-check.test.ts test(windows): isolate USERPROFILE per test, normalize path assertions 2026-04-25 11:25:34 +05:30