-
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
Pytest discovery fails with ENOENT #22395
Comments
Hello! Can you try on our rewrite that redesigns the architecture of how teseting works? To try it yourself, add this setting to your users You can confirm you have the rewrite enabled by setting If this doesn't fix your issue, please attach logs from the "python" output channel with the trace setting as decribed above. |
Hi @eleanorjboyd , I followed your advice, no luck. Please see below the logs. I am not fully sure, but conda itself is an alias in the shell, is the environment properly capturing this ? This is not my set up, this what happens when running conda init. It might be that the extension is using a different profile or not loading it properly.
|
Do you think it could be related to: #17641 (comment), thinking the conda activation might not be working as expected leading to the error. |
That's definitely possible. My hunch is that when you spawn you don't source the relevant profile. Can you detail what profile you would expect to be loaded ? It needs to find a PATH for instance, and as conda is defined as an alias, it needs to source that definition. Is there a way to run a "printenv && conda ..." ? |
@karrtikr, what are your thoughts here? This looks like another issue where it seems conda might not be activating correctly in the given scenario. |
@mattB1989 We do not have access to terminal or terminal profile/init scripts when we run tests, could this be because of that? |
@karrtikr I imagineso yes. To run a command like conda, it needs to be in the $PATH, and the way conda inits its shell is to add an alias.
conda docs |
@karrtikr, assigning this to you as well so you can follow up while I am out of office- thanks! |
Gotcha. Let me explore alternatives for you. @eleanorjboyd Can you point me to where this command is run:
|
I think I found the issue, ideally we should be running these commands using a shell, but we're using vscode-python/src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts Line 101 in 6333752
Adding the |
I'm guessing this is compiled / transpiled so I can't easily test this, can I ? |
@karrtikr and @karthiknadig, should I switch this to use shell even if it slows down the testing? Not sure the best answer here. |
I think we can potentially use That may be premature though, so I will say switch to using shell for now and explore the above in case it's slow enough to bother users. |
@karrtikr @paulacamargo25 do I need to switch to using shell just for the |
I think debugger uses a shell, so I would suggest to solve this issue just for |
Type: Bug
Behaviour
Expected vs. Actual
I expect the tests to get discovered, but instead I got a spawn error. There are other users who mentioned this before and managed to get around with restarting etc. but this does not seem to work. I tested in multiroot and simple folder, but I get the same issue.
Steps to reproduce:
This is the same as 15739
Observe process runs successfully and discovers pytest test.
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.14.0
VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:22:42.175Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 4.18.0-305.25.1.el8_4.x86_64
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: