Skip to content

bug(core): shellExecutionService.windows.integration.test.ts fails on Windows environments without PowerShell 7 (pwsh.exe) #29646

Description

@supunyasanthaofficial

Description

In packages/core/src/services/shellExecutionService.windows.integration.test.ts, the real-shell integration tests are guarded solely with:
`ts
describe.skipIf(!isWindows)
``
However, on standard Windows machines where PowerShell 7 (pwsh.exe) is not installed, getShellConfiguration() falls back to Windows PowerShell 5.1 (powershell.exe).

Because Windows PowerShell 5.1 mangles inline double quotes passed to native executables, 4 out of the 5 tests in the suite fail with exit code 1 (AssertionError: expected 1 to be +0).

As the test suite's docstring explicitly notes:

"These tests exercise the full pipeline end-to-end. They pass when gemini-cli selects pwsh.exe from PATH; they fail when the pipeline routes through Windows PowerShell 5.1."

Steps to Reproduce

  1. On a Windows machine where PowerShell 7 (pwsh.exe) is not installed on PATH.
  2. Run:
    bash npm test -w @google/gemini-cli-core -- src/services/shellExecutionService.windows.integration.test.ts
  3. Observe 4 failing tests.

Proposed Solution

Guard the test suite with: ts const hasPwsh = isWindows && Boolean(resolveExecutable('pwsh.exe')); describe.skipIf(!hasPwsh)(...);

This ensures the suite cleanly skips on Windows installations lacking pwsh.exe, while still running in environments that have PowerShell 7 (such as GitHub Actions CI runners).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmtstatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions