Use same pytest --rootdir logic as test discovery - #17898
Conversation
--rootdir logic as test discovery
--rootdir logic as test discoverypytest --rootdir logic as test discovery
| if (testArgs.filter((a) => a.startsWith('--rootdir')).length === 0) { | ||
| // Make sure root dir is set so pytest can find the relative paths | ||
| testArgs.splice(0, 0, '--rootdir', options.workspaceFolder.fsPath); | ||
| testArgs.splice(0, 0, '--rootdir', options.cwd); |
There was a problem hiding this comment.
Based on the logic below, this should use python.testing.cwd if it's set, otherwise the --rootdir option from python.testing.pytestArgs.
vscode-python/src/client/testing/testController/pytest/pytestController.ts
Lines 288 to 299 in b6c0d3e
|
Brian Rutledge (@bhrutledge) Can you provide a news file under |
|
Brian Rutledge (@bhrutledge) Please sign the CLA so we can review and merge this. |
Karthik Nadig (@karthiknadig) Sorry for the delay on this; I haven't signed a CLA before, and was waiting on some advice. In the meantime, I've installed the VSIX locally and verified that it sets Aside: I didn't find any documentation on how to use a VS Code extension while it's being developed, without manually installing the VSIX. I'm thinking of something equivalent to the "editable installs" provided via pip and setuptools. Is that possible? Can somebody point me in the right direction? Speaking of testing: I note that a check failed because this PR doesn't include TypeScript tests. However, it's not clear to me where to write such a test, and I note that #17509 didn't include tests. Any suggestions? |
|
Karthik Nadig (@karthiknadig) ICYMI, I've signed the CLA. |
|
Brian Rutledge (@bhrutledge) here are some instructions on how to build and run the extension during development. Build environments and compiling: https://github.com/microsoft/vscode-python/wiki/Coding There aren't any tests for this. I added this code as an intermediate step till we get to point of updating the pytest adapter. I think the test adapter that we currently use tries to do things that it should probably let pytest handle itself. We are currently in the process of re-doing the test adapters starting with the |
Thanks Karthik Nadig (@karthiknadig). I had read over those, but they didn't answer my question; I've opened #17931 for assistance.
I'm interested in following this. Can you share some relevant links? For this PR, is there anything else you need from me? |
|
Karthik Nadig (@karthiknadig) Can you take another look at this? Looks like some checks are still pending; don't know why. |
|
This failing test doesn't seem related to this change: https://github.com/microsoft/vscode-python/runs/4143672875?check_suite_focus=true |
|
That is due to |
…-python#17898) * Use same --rootdir logic as test discovery * Add news entry
This is a quick submission via github.dev, so please pardon the lack of local testing and adherence to the contributing guidelines.
For #9553, specifically re: the second issue described in #9553 (comment).
FYI Karthik Nadig (@karthiknadig), who touched this code in #17509.