Skip to content

test_nodebug broken if not running under tox #342

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

Open
int19h opened this issue Jul 23, 2020 · 0 comments
Open

test_nodebug broken if not running under tox #342

int19h opened this issue Jul 23, 2020 · 0 comments
Labels
P2 test issue Test failures and other issues with test runs and CI.

Comments

@int19h
Copy link
Contributor

int19h commented Jul 23, 2020

This is specifically for running those tests via VSCode after opening the debugpy workspace.

The problem is that it uses debuggee.backchannel, which tries to import a bunch of stuff from debugpy.common. And this fails, because debugpy itself cannot be imported, because it's not on PYTHONPATH.

We try to make sure that it's there by setting PYTHONPATH=./src in .env - but that only works for test discovery, not for debuggee processes spawned by the tests, because the latter run in a different directory, and thus the meaning of . changes.

The fundamental problem here is that PYTHONPATH needs to be set to an absolute path for it to work consistently, and yet there's no way to use ${workspaceFolder} etc inside .env, which is necessary for that to be set in a workspace-independent way; nor is there any other way to define environment variables with expansions like that for Run Test (Debug Test can use launch.json, at least). That's microsoft/vscode-python#11932 - but in the meantime, we can hack around this in tests by checking whether debugpy comes from site-packages or not; and if not, manually add it to PYTHONPATH for debuggee.

@int19h int19h added the test issue Test failures and other issues with test runs and CI. label Jul 23, 2020
@int19h int19h self-assigned this Mar 31, 2021
@int19h int19h removed their assignment Sep 27, 2022
@judej judej added the P2 label Jan 3, 2024
@judej judej assigned debonte and unassigned debonte Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 test issue Test failures and other issues with test runs and CI.
Projects
None yet
Development

No branches or pull requests

3 participants