-
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
tests are not being discovered #22018
Comments
This started to work when I opened my project from the realpath. VS Code file opened as: VS Code file opened as:
|
Hello! Could you try this on the rewrite of the testing infrastructure to see if it occurs here? You can do so by adding this setting to your users You can confirm you have the rewrite enabled by setting Let me know if the rewrite fixes your issue. Thanks! |
The same problem with a symlink. Linux (EndeavourOS), vscode 1.82.2, a python 3.11 env managed by the poetry. The unittest can find tests but the pytest cannot. Pytest works well with a realpath |
Can you clarify what your setup is with the two root paths? Are those on the same computer? I have been trying to repro this symlink issue but have been unable to. If you are able to review the steps I took here and let me know how your setup differs that would be very helpful! #21373
|
Can confirm that I have a similar issue as well.
My file paths look like this:
where I have the symlink
and Opening any repository from Running pytest from the terminal works in both places.
Tried doing this, couldn't figure out how to confirm that the rewrite was working (should System information:
|
Oh and one more thing: the output of
appears to list all tests when I run the command myself from the symlink version of the repositories |
Hi @rohanaras could you try this on the rewrite? It looks from the output you are still on the older code. To try it yourself, add this setting to your users You can confirm you have the rewrite enabled by setting Let me know if the rewrite fixes your issue. Thanks! |
For those using WSL on Windows, the "python.experiments.optOutFrom" will not be supported on your local user settings, you should use the remote user settings. |
do you have any logs after the test structure is returned in the logs? It seems it is discovering it on the pytest side (as shown by the logs) so the disconnect must be either sending the data to the vscode extension or parsing the data from the vscode extension and populating the UI. This is the common example I use to send my team members so they can test this feature:
interesting about the space, I will think on that / investigate. I am going on vacation for a few weeks so sadly I cannot investigate now |
Ok, just one glitch. Now I see the issues reported in other tickets. I have a project for which some tests are not working:
|
thank you for your investigation @alanwilter! All these notes are extremely helpful. So just to make sure I have it right, the repo I sent you worked when you removed it from using symlinks? (when you said "I used the realpath" not sure where you are saying you used the realpath). Therefore to replicate this issue I only need a symlink on my computer similar to |
|
Thanks for the extra info! The fix to issue #22447 is in our next release so that will go out around thursday next week! |
I've tested this new release and after a lot of headache, I got it to work again but it's not ok. Still, sorry, useless in my case. This new Test definitely uses [tool.pytest.ini_options]
addopts = "tests --cov=faceapp --cov-report=term-missing:skip-covered --cov-report=xml -n 8" And I can't deactivate it with "python.testing.pytestArgs": ["tests", "-vv"], //, "-c", "/dev/null"], because if The problem is: if I keep my I'm going back to the Old "good" Test. The new Test really need to be independent of PS: I've only tested the |
@alanwilter, I am seeing the following problems from what you have discussed that I need to investigate. Please correct me if I have one of these wrong
In terms of the
@paulacamargo25, can you look at number 3 I listed above about "vscode debugging not working when Thanks |
Perfect summary. So, the fact that the "Old" Test works is because I can pass |
Hi @alanwilter, sorry for all the back and forth. I have created the following sample project and am having the '-c' option working for me. I also created a |
Thanks @eleanorjboyd, using dummy So, the only issue pending now it the symlink. If I do: ln -s cwd_specified llll
code llll your example test won't work. |
@alanwilter thank you so much for the example, that was finally the symlink repro that worked for me and I was able to investigate the problem!! I have created this issue to consolidate all symlink related bugs: #22658. I worked out a solution on Friday but it ended up being more complicated than expected so it will require some more work. I will post updates there, thanks |
The issue mentioned above now include a proposed solution. 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! |
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. |
Hi @alanwilter, just got back from vacation and unlocked this. Could you describe the issue you are still seeing? Is it still the same setup as this? I have been testing it in a few scenarios and it has been working for me recently but I must still be missing a scenario. Thanks
|
Also can you send over your pytest args when you describe your setup? I think this could be contributing if you already specific a cwd or rootdir but I would have to check further. |
Hello again! Recently I have merged this PR which was very similar to your symlink issue. I think that merge should resolve this but please let me know if not and I can keep investigating. Thanks! |
Type: Bug
Tests for python project are not appearing in VS Code.
In the terminal output I foud the command that is executed.
This command returns proper tests
VS Code version: Code 1.82.2 (abd2f3db4bdb28f9e95536dfa84d8479f1eb312d, 2023-09-14T05:51:20.981Z)
OS version: Linux x64 6.2.0-32-generic snap
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Extensions (43)
A/B Experiments
The text was updated successfully, but these errors were encountered: