-
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
symlink: Pytest immediately finishes without running #22518
Comments
Hi! Could you check in your "python test logs" and send those? Might be something happening on the python side which shows up there. Also to confirm these are all the logs right after you click the run button? I am seeing no logs related to an attempted run since after clicking the "play" button there are usually additional logs printed right away. |
Hi, this is all that I see in Python Test Logs:
This is right after I click the play button on the sidebar under Testing, yep. Nothing new shows up in the Python logs, here is the last snippet of those.
It's worth noting 1) this is local, not SSH 2) Running regular old |
Could you try running this again but this time without Secondly do you see anything in your logs which say "data received from python server:"? It is a debug level so maybe setting your log level via the command palette "developer: set log level" to debug or trace could help produce these logs which give a better idea of what could be happening. |
Actually, after a delay (7 minutes) I do see these messages in the Python log (first message in the snippet below is the last message from my last reply):
Is this helpful? You see two paths here:
Edit: I do see
|
hm yes we have been having ongoing issues with symlinks. Does this look like it could be similar? #22018 secondly do you see the following as well in your logs (below is the example with my own logs of the necessary steps it prints after getting the data)? It seems your data is returning correctly from the pytest process but is not being parsed and displayed correctly
|
I do see something like your logs in mine:
Okay, yes this is somehow related to the symlink. I opened from the non-symlinked (i.e., source) location, ran a test, and it worked. I then opened again from the symlinked version and testing is working. Perhaps something with caching an unresolved path? |
hm thats an interesting theory about the unresolved path. I will work on this soon as my primary blocker is I have not been able to repro locally. Does your setup align with that of the most recent poster on that thread? Where the symlinks have the same root and they are both locally on the same machine? |
I think my setup mostly aligns with that thread, yes. When I open the project from the two different directories, I even see two different entries under "Recent" on the "Welcome" page. If I open from the symlink on the Welcome page, tests are not working ("Finished running tests!" shows up immediately). If I open from the source on the Welcome page, then tests run. |
Hello! I have put together a detailed problem report and proposed solution for symlinks. Please check it out here and contribute any thoughts you may have: #22658 |
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! |
I am having a similar issue. You can check this tagged commit. A screenshot is available at https://imgur.com/gallery/qGgkyRI No matter how many times I run the unit tests, nothing happens
Running unit tests manually from the command line works: python3 -m unittest discover -s tests
sys.path=['/media/nicc777/data/nicc777/git/Personal/GitHub/poc_pytaskflow/tests', '/media/nicc777/data/nicc777/git/Personal/GitHub/poc_pytaskflow', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/media/nicc777/data/nicc777/git/Personal/GitHub/poc_pytaskflow/venv/lib/python3.10/site-packages', '/media/nicc777/data/nicc777/git/Personal/GitHub/poc_pytaskflow/tests/../src']
Current Working Path: /media/nicc777/data/nicc777/git/Personal/GitHub/poc_pytaskflow
--------------------------------------------------------------------------------
df={'a': 'AA', 'bb': {'c': 123, 'dd': True}, 'ccc': [1, 2, 3]}
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK Output
Output
Output
Let me know if you need anything else. |
UPDATE: I resolved my problem after a lot more reading that indicated that symlinks may be a problem. So, I have 2x SSD's. In my home directory ( $ ls -lahrt | grep git
lrwxrwxrwx 1 nicc777 nicc777 31 Sep 2 2022 git -> /media/nicc777/data/nicc777/git Initially I opened the project from the perspective of my home directory. So in VSCode, I navigated to Afterwards I opened the project from this directory: Now everything works as it should. Screenshot: https://imgur.com/gallery/hxKMvED So in my case this problem was symlink related. It seems sometimes VSCode refers to the real path and sometimes to the linked path and this inconsistency causes the problem. |
The bug was referenced but the symlink issue is know and I will get to it soon! Thanks |
Hello! This bug should be fixed and on vscode insiders! The release to vscode stable will be out by the end of the week. Please let me know if you try it on insiders or stable when it comes out and still doesn't work and I can investigate your specific issue further. |
I'm still running into this problem. I'm using Python extension v2024.3.10731011 (pre-release).
All is well if I open Diagnostic data
Output for
|
I can confirm this issue my vscode has the same behaviour. I am inside my WSL and in my home dir i have a documents symlink linked to a WSL folder inside my windows file system (my documents).
If im inside of that symlink my vscode doesn't load any tests. If I move my workspace into an "normal" WSL folder /home/myusername/workspace It runs the tests normally as intended. |
@derDere - Sounds similar to my case. It should work if you open "/mnt/d/Users/myusername/WSL Home Contents/Documents'" - can you confirm? I have a similar situation on my work laptop (using WSL) but these days I just keep my git repo in WSL and be done with it. You can easily navigate from Windows to that WSL directory if you need to. |
@eleanorjboyd any update on this issue? |
Hello, sorry for the delay as I have been working on other areas. I will investigate this soon and get back to you all- thank you for the detailed repro steps! |
I have made the following symlink to try and repro your scenario and am able to get tests working:
What about my setup do I need to change to see this issue? |
I see two differences with my setup that might be relevant:
Here is
|
Can you turn on trace for logs then send me them? I need to see if the symlink is recognized by vscode and if it even hits my edge case I put in to resolve it. I have a mac so I am having trouble reproing since it seems vscode resolves paths. What I am seeing is I can't to open the symlink sub-folder without vscode resolving it. I can also speak with my colleague who works on that specifically. The logs should include this trace log if it recognizes it as a symlink and adjust accordingly Also is both discovery and execution breaking or just one of those which does work? And to confirm you are using pytest right? Sorry for all the questions and I appreciate your help! |
Type: Bug
Behaviour
Expected vs. Actual
Actual: Tests are discovered in the GUI, but running any test immediately shows "Finished running tests!" in the Test Results pane, without running the test.
Expected: Clicking the arrow next to a test (or all tests) runs the test.
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)(Some names scrambled...)
User Settings
Extension version: 2023.20.0
VS Code version: Code 1.84.1 (2b35e1e6d88f1ce073683991d1eff5284a32690f, 2023-11-06T12:37:18.666Z)
OS version: Darwin x64 21.6.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
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
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: