- Ensure 'SystemRoot', 'COMSPEC', 'windir', and 'PATHEXT' are passed to node-pty on Windows to prevent 'posix_spawnp' failures.
- Clean up test directories in 'TestRig.setup' to ensure a fresh state for retries and prevent telemetry log accumulation (fixing the 1, 2, 3 failure pattern).
- Fix path normalization in 'Hook Disabling' test to ensure disabled hooks are correctly matched on Windows.
Part of https://github.com/google-gemini/gemini-cli/pull/18665
- Enforce 'sequential: true' for all hook tests to prevent telemetry leaks and race conditions.
- Normalize all path assertions in hooks-system.test.ts using a new 'normalizePath' helper to handle Windows backslashes consistently.
- Update 'createScript' in test-rig to return normalized paths.
- Ensure 'PATH' is explicitly passed to node-pty spawn options to prevent 'posix_spawnp' errors in some environments.
- Clean up manual path replacements in tests in favor of the centralized helper.
Part of https://github.com/google-gemini/gemini-cli/pull/18665
- Refactored remaining hook tests in hooks-system.test.ts to use 'rig.createScript' and forward slashes for cross-platform path compatibility.
- Replaced 'node -e' usages with script files to avoid brittle quoting and escaping issues on Windows shells.
Part of https://github.com/google-gemini/gemini-cli/pull/18665
- Increase default timeout for TestRig.run and TestRig.runCommand to 10 minutes on Windows CI to handle slow environments.
- Replace inline 'node -e' hook commands with script files to avoid brittle quoting and escaping issues on Windows shells.
- Add 'TestRig.createScript' helper to simplify script creation in tests.
- Fix path escaping for hook output files in 'hooks-agent-flow.test.ts' using JSON.stringify.
- Ensure 'TestRig.setup' is called before performing file operations in tests.