-
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
Custom Test Discovery Option #23047
Comments
In #21922 (comment) @brettcannon wrote:
Yes, it does. We wrote a pytest plug-in that does custom collection and execution: (I'm replying here because #21922 is locked to new comments.) |
@juandiegopalomino but do be aware that VSCode's Python plugin occasionally breaks our use of pytest, e.g. #8242/#8425 (our workaround: stb-tester/stbt-rig@89f7a27) and #22076/#22885/#22999 (our workaround: stb-tester/stbt-rig@a88df29). I suppose twice in 5 years isn't too bad, and in both cases we were able to implement a work-around, but it did break the VSCode integration for our users. The vscode-python team also don't seem to test against older (but still supported) versions of pytest? e.g. #22457. But this one didn't affect us. I'm just saying you might want to consider writing a custom VSCode plugin; maybe VSCode's plugin API is more stable (but I have no experience with that). |
@drothlis hi! Wow! Your code is awesome, it helps so much! One question though-- it looks like the pytest plugin will still execute for all the python files in the repo (i.e. it will go one by one through all of my files). That might still be too long, as that would still be thousands of files 😅 . Is there anyway to say "just run this on the currently opened files?"? |
It's just grepping for
You could try adding |
We do now:
|
hi @juandiegopalomino, looks like you got some awesome suggestions from @drothlis, thanks @drothlis for helping out! Two points:
|
@eleanorjboyd I'm going to pry a bit in here, but option two seems very interesting! 😅 |
Hi! If you are interested definitely give the original issue an upvote as we decide prioritization of tasks based on community interest (as measured by upvote count) #4586 |
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! |
Type: Feature Request
Behaviour
Expected vs. Actual
Hi there!
So right now, the python test suite discovery relies on pytest running with the --collect-only flag. For normal projects, this works fine as this pytest command would take 1-2 seconds. But if you happen to have a really big python project with 80K tests and counting like in my company, Rippling, then the test collection takes over 10 minutes, and usually breaks the editor with too much data.
Here for the typescript version
And here for the python version
We really need to overcome this if we are to officially adopt VS Code as our editor for the company.
Before making a whole private extension to support this, I would like to double check one more time (I first checked in October, but I know things might have changed since then) if there is anything official coming up for this. This problem is really like the last big blocker, and I'm sure that other companies with large codebases are facing it right now too.
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
)User Settings
Extension version: 2024.2.1
VS Code version: Code 1.87.0 (Universal) (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:56.944Z)
OS version: Darwin arm64 23.3.0
Modes:
The text was updated successfully, but these errors were encountered: