Skip to content

[Bug]: Tests failing on WSL #2970

@lissy93

Description

@lissy93

Bug Description

When I run uv sync --extra test, then uv run pytest. I got 16 failures.

All these are from the PowerShell script tests (test_setup_tasks.py, test_setup_plan_no_overwrite.py, test_setup_plan_feature_json.py, test_check_prerequisites_paths_only.py), even though I don't have PowerShell installed.

The bash equivalents of these tests skip cleanly, and so do most of the other PowerShell tests in the suite, so I expected these to skip too.

I think the cause is in how powershell gets detected:

_POWERSHELL = shutil.which("powershell.exe") or shutil.which("powershell")

Since it IS in the path, the tests then think PS is availible, but WSL cannot run the PS1 fixtures.

Steps to Reproduce

  1. On WSL (Windows interop enabled) without pwsh/PowerShell installed inside Linux.
  2. uv sync --extra test
  3. uv run pytest -q
  4. 16 failures in the PowerShell script tests.

Expected Behavior

With no usable PowerShell available, the PowerShell tests skip (like the bash tests skip when bash isn't usable).

Actual Behavior

They run against the Windows powershell.exe exposed by WSL interop, which can't execute the Linux-path scripts, so they fail with empty output.

Specify CLI Version

0.10.2 (also reproduces on main, currently 1b0556c)

AI Agent

Not applicable

Operating System

Ubuntu on WSL2 (Windows 11 host)

Python Version

Python 3.12.12

Error Logs

FAILED tests/test_setup_tasks.py::test_powershell_command_hint_preserves_hyphens_inside_segments
  assert result.stdout.strip() == "/speckit.jira.sync-status"
  AssertionError: assert '' == '/speckit.jira.sync-status'

# Running the resolved exe directly shows why stdout is empty:
. : File \\wsl.localhost\Ubuntu\tmp\...\common.ps1 cannot be loaded because
running scripts is disabled on this system.
Format-SpecKitCommand : The term 'Format-SpecKitCommand' is not recognized...

Additional Context

Only affects WSL (interop exposing powershell.exe while pwsh is absent)

On native Linux without interop, powershell.exe isn't on PATH, _POWERSHELL is None, and the tests already skip. CI is unaffected: ubuntu-latest ships pwsh, and windows-latest keeps os.name == "nt"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions