Skip to content

Vscode 1.104 Testing Panel does not see the $PATH anymore #25682

Closed as not planned

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.104
  • OS Version: macOS Sequoia 15.6.1 (24G90)

I have a python project whose pytest works fine in Vscode Testing panel. My integration test depends on a binary (typst, installed via homebrew).

With the new Vscode 1.104 this is broken, it does not see the $PATH and does not find typst.

Activity

  1. eleanorjboyd commented on Sep 12, 2025

    @eleanorjboyd
    Member

    Few questions:

    • are you running test or debugging tests?
    • do you have the python environments extension installed?
    • how are you added it to the $PATH var?
  2. alanwilter commented on Sep 15, 2025

    @alanwilter
    Author

    I'm using Run Test. But Debug Test and Run Test with Coverage fail the same way.

    Image

    I have Python Environments extension. With or without it, the issue is there.

    I work on a Mac and I use homebrew. I don't do anything special for the $PATH, never needed. If I run pytest in my vscode terminal, the integration tests passed fine, no wonder, since which typst is in the $PATH.

    But something happened in Vscode v1.104 and when I run the Testing via GUI it fails.

    Image

    FYI, I circumvented this development issue by embedding the binary in my python package. But the issue is there, and with v1.103 it was not.

  3. eleanorjboyd commented on Dec 15, 2025

    @eleanorjboyd
    Member

    Hi! Sorry on the delay here- are you still facing this issue?

  4. alanwilter commented on Dec 16, 2025

    @alanwilter
    Author

    The answer is yes and no.

    You can use Vscode debug mode to peek r1.stdout:

    def test_system() -> None:
        r1 = run(["sh", "-c", "echo $PATH"], capture_output=True, text=True)
        assert r1.returncode == 0

    And then you'll see that, for Mac users with homebrew, /opt/homebrew/bin/ is not there. But the python env is, e.g. .pyenv/versions/3.12.11/envs/mbpdfgen/bin.

    Perhaps it's just a matter of configuration, but I frankly don't know where to add e.g. /opt/homebrew/bin/.

  5. eleanorjboyd commented on Dec 17, 2025

    @eleanorjboyd
    Member

    Looping in Anthony Kim (@anthonykim1) - Potential Interaction with Activation Hooks Change

    Issue: Tests run via the Testing Panel on macOS are missing /opt/homebrew/bin and other system paths from their PATH environment variable (only showing /usr/bin:/bin:/usr/sbin:/sbin - 29 chars vs expected ~500+ chars). Tests work fine when run in the integrated terminal.

    idea of cause?

    The Extension Host process starts with a truncated PATH (just /usr/bin:/bin:/usr/sbin:/sbin). Previously (1.103), activation happened via shell profile modification which may have ensured the full PATH was available. Now with shell integration scripts (1.104), there may be a timing issue where:

    1. Tests start running via runInBackground (Python Envs extension path)
    2. Extension Host hasn't completed shell integration yet
    3. Tests get the truncated Extension Host PATH instead of the full shell PATH

    Diagnostic logging shows:

    • Extension Host process.env.PATH: 29 chars (truncated)
    • User's actual shell PATH: ~500+ chars (includes /opt/homebrew/bin)
    • The PATH is already truncated when we first access it in our activation code

    I could (on the testing side) explicitly query the user's login shell to get the full PATH in activation/service.ts. But this doesn't feel like the best option. What are your thoughts Anthony Kim (@anthonykim1)? What is the expected experience here?

  6. github-actions commented on Jan 17, 2026

    @github-actions

    Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

    Happy Coding!

  7. anthonykim1 commented on Jan 29, 2026

    @anthonykim1

    I dont think we spawn terminal when running tests via testing panel, but rather we seem to spawnProcess like: https://github.com/microsoft/vscode-python-environments/blob/d0edb908470e408dcab9c7641aa9eb206462e4b6/src/features/execution/runInBackground.ts#L42-L45

    Which means it never have had access to shell integration nor the profile stuff.
    Maybe this just used to somehow work in python extension then user got rolled into env ext experiment.

    I don't remember us touching PATH ever since the old python terminal env var experiment stuff. I dont even know if this even matters since the issue only seem to happen when not in terminal.

    For env extension we could try spawning like a dummy shell before spawnProcess and make it inherit the missing path?

  8. github-actions commented on Mar 1, 2026

    @github-actions

    Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

    Happy Coding!

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

Metadata

Metadata

Labels

info-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions