-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Discovery Failing in all repos (for the Testing Panel) #23447
Comments
I have the same problem with discovering pytests. When I switch to Extension version: 2024.6.0 Python Log Output
System Info
A/B Experiments
|
This started happening to me after VS Code updated today. |
Hi! We have not made a change to unittest recently- is everyone seeing this on unittest or with pytest too? Could someone try just running unittest/pytest from the command line and seeing if they see similar permissions issues? |
I only use unittest so I can't speak for pytest. However, I can run unittest from the command line with no issues. I can even run the debugger on unittest files. It is just the test discovery that is failing and leading to not being able to use the testing side panel to run anything. |
Interesting, it seems that your error |
Today, after I restarted my computer, the Testing tab opened the test configuration dialog. I selected pytest and the configuration file, and the tests appeared. This is what I see in the Python Output tab:
There are some errors about test discovery being already in progress, and finally the permission denied error. Anyway, I can attempt running a test, but the test won't run. In Python Output tab I can see the same permission denied error for test execution:
My code is in WSL and I'm using pytest. I can run the tests from WSL command line using |
I can collect the tests without problems from the command line
|
@karthiknadig any thoughts here on what could be causing people to suddenly have permissions issues? |
@eleanorjboyd This is the issue with using Unix Domian Socket for communication:
We are working on a fix for this to use |
Sorry for the delay on this.
Do you mean in the output tab when running the tests with the debugger? (SEE BELOW) When running the debugger on a unittest file, this is what gets logged to
And this it what appears in
Neither seem to reference the same pipe.
I don't believe so, I have not updated any settings recently. However I am using WSL on a Windows machine, but again, I have not changed any settings in my WSL or on Windows (other than system updates). |
It started working when I installed the version 2024.4.1 of the Python extension. @karthiknadig are you thinking about enabling Unix domain sockets in Windows or in the WSL distribution? Any idea how to do that? |
@senarvi we are working on using |
Also, for this bug, is it expected to see the "Testing" window showing like this? Despite running "Configure Python Test" multiple times Having the "Build your C# test project" is a bit weird. I also have been seeing VS Code attempts to use pytest even though i'm explicitly using unittest in the configuration. |
Does there currently exist any workaround for this topic? It is completely blocking me from using vscode python extension above 2024.4.1, since testing is integral to my work --- and I assume many others as well? |
I find myself in this thread again because I forgot to uncheck autoupdate :) |
Newest version (2024.12.3) still has this issue. The workaround in #23785 works. |
Hi! The testing window should update but if you have multiple extensions contributing to the testing pane (in your example it seems C# is) this might cause it to show up incorrectly. Please file an issue and I can investigate this further to make sure multiple testing extensions work correctly together! Secondly can you try reloading your window? Then checking your settings.json to make sure the right is enabled for the pytest vs unittest? If that still isn't working send me over the full logs and your settings and I can take a look. Thanks |
I was struggling to fix this for a long time (#23785 didn't work for me), and I finally managed to do a hacky fix for it:
Hope this fixed problems for you |
Thanks a lot kelj0, this workaround fixes the issue in WSL. We used a simplified version: sudo mkdir -p /run/user/1000
sudo chmod 777 /run/user/1000 |
Type: Bug
Behaviour
When trying to use the VSCode Testing from the sidepanel, Tests are not Discoverable due to a permissions error.
I first noticed this in a single repo I was working in. I opened up another repo to see if the error persisted and it did. Then I created a separate directory with a very simple example to test and the error still occurred there as well.
Example file structure:
As far as I know, nothing has changed in my system, no major updates or upgrades have happened before or since this started happening. Perhaps a
chmod
is needed but I am hesitant to do that without knowing why.Why is this only occuring now? Has there been a change to the files used for the
Testing
execution in the last few days/weeks?I was able to restart my computer this morning, open up a repo and run 1 test via the VSCode
Testing
but it only allowed me to run the singlular test before showing the error again.I aslo recreated my Virtual Enviroment but that did not work either.
Steps to reproduce:
Testing
tab in the side panelUnittest Discovery Error
Outputs
tab toPython
Tests CAN be run successfully from the command line:
python -m unittest discover
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.6.0
VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.146.1-microsoft-standard-WSL2
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: