qwen-code/packages/cli
易良 a3b5b4d856
fix: make the test suite portable on Windows (#8050)
* ci: add temporary Windows compatibility validation

* fix(acp): resolve sandbox mounts with POSIX semantics

* test: normalize Windows runner environment

* ci: fix Windows validation environment setup

* fix: make path handling portable on Windows

* test: make suites portable across Windows

* ci: normalize Windows validation environment

* fix: finish Windows test portability

* test: finish Windows runner validation

* test: stub Windows efficacy probes deterministically

* fix(review): launch npx correctly on Windows

* fix(test): harden review probe portability

* test(cli): keep bridge spawn assertions strict

* fix: address remaining Windows-portability review feedback

- Split cursor integer validation: relax dev/ino to Number.isInteger for
  Windows 64-bit file indices (which exceed 2^53) while keeping
  snapshotSize/position safe-integer, since those are arithmetic operands.
- Derive session-mention unescaping from the shared SHELL_SPECIAL_CHARS set
  via a new unescapeShellSpecials helper, so the escape set no longer diverges
  between POSIX and Windows.
- Restore test teeth: a distinguishable realpath mapping in the weixin send
  test, and exact-basename assertions in the review paths test.
- Nits: report POSIX-only skips via it.skipIf instead of if-wraps, inline
  path.posix in installationInfo, name the win32 traversal assumption in
  permission-manager test titles, explain the NUL-byte transcript trick, and
  use a single LC_ALL=C.UTF-8 in the Windows runner workflow.

* fix: address Windows-portability review feedback

- Run the Windows runner env-config step under pwsh so Out-File writes
  UTF-8 (no BOM) into GITHUB_ENV; Windows PowerShell 5.1 wrote UTF-16LE,
  which the runner parsed as UTF-8 and silently left TEMP/TMP unset. Also
  echo TEMP in the verify step so a regression is visible in the logs.
- Restore the not.toHaveProperty('sessionScope') assertion in the serve
  bridge test: toEqual ignores undefined-valued keys, so on its own it no
  longer proved the sessionScope key is truly absent.
- Drop the now-dead chmodSync on the fake vitest runner, which is invoked
  through process.execPath so the executable bit is irrelevant.

* fix: address follow-up Windows-portability review feedback

- Resolve the probe's vitest entry via createRequire + the package bin field instead of a hard-coded path, with self-explaining errors

- Normalise result-path separators only on win32 so a POSIX backslash filename cannot false-match a probe

- Add a literal V1 projection test, a vitest-entry canary, and a TEMP-redirection assert; clarify intent comments

* test(cli): fix session-scoped symlink test setup

* ci: use Windows PowerShell for runner setup

* test(cli): respect localized extension list output

* ci: limit Windows validation to workspace tests

* docs(ci): clarify Windows validation scope

* test(cli): create session-scoped parent in symlink fixture (#8050)

* test(cli): cover vitest bin resolution errors

* fix(cli): preserve runtime session cleanup after merge

* fix(test): cover Windows portability edge cases

* test(core): cover session profiler without nofollow

* fix(review): expose dependencies to efficacy probes

* fix(review): isolate efficacy probe caches

* fix(review): preserve probe dependency bins

* fix(review): ignore dependency metadata files

* fix(review): address probe symlink assertion and doc comment placement (#8050)

* test(cli): tighten dependency exposure assertions

* fix(cli): use file URL for ESM import specifier in probe test (#8050)

On Windows, join() produces backslash paths that break ESM import
specifiers (\\x is parsed as a hex escape). Convert to a file URL
via pathToFileURL so the generated vitest.mjs is valid on all
platforms.

* fix(cli): skip broken probe dependencies

* test(cli): cover Windows review edge cases

* fix(windows): platform-aware archive path, symlink error handling, probe normalization

* fix(test): align archive-path assertions with mocked join and retry Windows cleanup

sessionService.test.ts mocks path.join to always join with '/', so the
readdir dir checks must match '/'-separated paths; using path.sep broke
them on Windows where sep stays '\' under the automock.

The channel webhook tests remove temp trees that Windows can still hold
briefly (extension-store watchers), turning rmdir into ENOTEMPTY; give
fsp.rm the standard maxRetries/retryDelay backoff.

* docs(review): correct probe spawn failure comment

* fix(review): address probe-runner and profiler review feedback

Distinguish a present-but-hidden vitest from a missing one in findVitestBin,
guard the remaining per-entry calls in exposeDependencies and disclose a
partial dependency farm instead of failing silently, fold case when matching
probe paths on Windows only, key the profiler's O_NOFOLLOW trade on the
platform rather than the flag's presence (with a test pinning the symlink
pre-check as the Windows guard), and normalise the platform-skip test idioms.

---------

Co-authored-by: qwen-code-dev-bot <qwen-code-dev@service.alibaba.com>
Co-authored-by: Qwen Code Autofix <qwen-code-autofix@users.noreply.github.com>
Co-authored-by: Qwen Autofix <autofix@qwen-code.bot>
Co-authored-by: qwen-code-dev-bot <qwen-code-dev-bot@users.noreply.github.com>
Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com>
2026-08-01 05:16:58 +00:00
..
src fix: make the test suite portable on Windows (#8050) 2026-08-01 05:16:58 +00:00
.gitignore feat(core): add opt-in built-in web_search backed by the DashScope Responses API (#7215) 2026-07-21 10:59:36 +00:00
index.ts fix(cli): add bootstrap fast paths (#6188) 2026-07-02 22:28:11 +00:00
package.json fix(external-context): harden MCP dependencies (#8206) 2026-08-01 01:04:16 +00:00
test-setup.ts feat(serve): persist dynamic workspace registrations (#6716) 2026-07-11 16:49:40 +00:00
tsconfig.json feat(channels): add GitLab polling channel adapter (#7862) 2026-07-29 14:28:31 +00:00
vitest.config.ts fix(serve): isolate managed memory by selected workspace (#8056) 2026-07-31 15:06:38 +00:00