You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Testing code lenses don't show for remote sessions to a directory symlink. #7443
OS and version: WSL (Windows 10.0.18362 Build 18362)
Python version: Conda 3.7.4
Type of virtual environment used: Conda
Relevant/affected Python packages and their versions: pytest-5.0.1
Expected behaviour
I am using python in a conda environment in WSL. I configured VS Code to use the correct WSL python interpreter, and I expected that the code adornments would be available.
Actual behaviour
VSCode discovers the test and it can be run , but there is no visible adornment.
WSL (no code adornments):
Interestingly, I installed conda/python on Windows, and when I switch over to that interpreter in VS Code, the code adornments are available.
Windows (code adornments available)
Steps to reproduce:
Install pytest.
Write a test
Choose the WSL Conda python interpreter
Code adornments not available.
vs.
Disconnect from WSL
Choose the Windows Conda python interpreter
Code adornments become available
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
Hi Don,
To be more explicit, I do the following:
1. Open Windows Terminal to start WSL,
2. conda activate APT (to go into my the conda environment)
3. cd to the project folder
4. enter "code ." to start VSCode
I also have the Remote - WSL v0.39.5 Extension installed.
Is what you mean when you say open VSCode inside WSL?
Thanks,
Phil
On Tue, Sep 17, 2019 at 12:35 PM Don Jayamanne ***@***.***> wrote:
Choose the WSL Conda python interpreter
Please note, if using wsl you'll need to open VSCode inside wsl using the
remote extension in VSCode.
i.e.wsl is supported (by then python extension) only when VSCode is
launched inside wsl using remote extensions.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#7443?email_source=notifications&email_token=AB4B6XWHNXPAMQGX3YFXV5LQKEWOVA5CNFSM4IXUGMY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD65U57A#issuecomment-532369148>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4B6XS56E7NW2APUIFL2UTQKEWOVANCNFSM4IXUGMYQ>
.
I think I figured it out. The problem has something to do with running code . from a directory derived from a symbolic link.
When I cd to the absolute path and then run code . , the code adornments become available.
cd
Before, I had cd'ed to the path via a symbolic link and then run code ., which wouldn't show the code adornments.
Thanks for letting us know about this, Phillip Yen (@yphillip). I was able to reproduce the problem via both remote-WSL and remote-SSH (to a linux host). I was not able to reproduce this with "code ." directly on linux. We will investigate further.
Repro
To reproduce:
run mkdir /tmp/test-7443
run ln -s /tmp/test-7443 /tmp/test-7443-lnk
create /tmp/test-7443/test_spam.py with content of def test_spam(): assert True
open /tmp/test-7443-lnk in VS Code (on WSL: code /tmp/test-7443-lnk; over SSH: use UI)
open test_spam.py
in the command palette, run the command to configure tests (pytest)
Via remote-WSL or remote-SSH, the code lens for the test does not show up. (Note that the test does show up in the test explorer on the left.) Both remote sessions work correctly if /tmp/test-7443 is opened directly (rather than the symlink).
changed the title [-]Code Adornment doesn't show for pytest in WSL[/-][+]Testing code lenses don't show for remote sessions to a directory symlink.[/+]on Sep 19, 2019
Activity
yphillip commentedon Sep 17, 2019
yphillip commentedon Sep 17, 2019
My colleague showed me another way to start VS Code with WSL, and in this way, the code adornments become available:
Still unsure why this method works for showing the adornments, but the
code .from the WSL Windows Terminal method doesn't work.yphillip commentedon Sep 18, 2019
I think I figured it out. The problem has something to do with running
code .from a directory derived from a symbolic link.When I
cdto the absolute path and then runcode ., the code adornments become available.cd
Before, I had
cd'ed to the path via a symbolic link and then runcode ., which wouldn't show the code adornments.ericsnowcurrently commentedon Sep 19, 2019
Thanks for letting us know about this, Phillip Yen (@yphillip). I was able to reproduce the problem via both remote-WSL and remote-SSH (to a linux host). I was not able to reproduce this with "code ." directly on linux. We will investigate further.
Repro
To reproduce:
mkdir /tmp/test-7443ln -s /tmp/test-7443 /tmp/test-7443-lnk/tmp/test-7443/test_spam.pywith content ofdef test_spam(): assert True/tmp/test-7443-lnkin VS Code (on WSL:code /tmp/test-7443-lnk; over SSH: use UI)test_spam.pyVia remote-WSL or remote-SSH, the code lens for the test does not show up. (Note that the test does show up in the test explorer on the left.) Both remote sessions work correctly if
/tmp/test-7443is opened directly (rather than the symlink).ericsnowcurrently commentedon Sep 19, 2019
Note that this may also be a problem with upstream VS Code, rather than the extension. We'll figure that out.
[-]Code Adornment doesn't show for pytest in WSL[/-][+]Testing code lenses don't show for remote sessions to a directory symlink.[/+]sammo commentedon Sep 30, 2019
Same issue here. No adornments for
pytest. I'm using vscode on mac Mojave and a python 3.7.3 conda environment.BoPeng commentedon Jun 3, 2020
Same here, I do not know what is WSL ad I do not have any symbolic link in the path. I am in conda python 3.8 environment under mac catalina.
Edit: I really do not know what happened, these
Run Testadornments suddenly appeared.brettcannon commentedon Jul 29, 2021
In our upcoming test provider we won't have codelenses, but there will be gutter icons which do work under e.g. WSL.