Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IntroduceautoTestDiscoverOnSavePattern configuration option#24728

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

soceanainn
Copy link

@soceanainnsoceanainn commentedJan 17, 2025
edited by karthiknadig
Loading

Closes#24817

What this change does

IntroduceautoTestDiscoverOnSavePattern configuration option to controlautoTestDiscoverOnSaveEnabled behavior to only attempt test discovery refresh when files matching the specified glob pattern are saved.

Why this change

In a Python project we have with over 40K tests, developers definitely notice issues when pytest discovery is running whenever any file in the workspace is saved, despite all tests matching a very consistent pattern (./tests/**/test_*.py).

Other alternatives I considered

I did consider trying to match only the specific patterns used by unittest/pytest here. Given that would require parsing underlying configuration files / raw args in the test configuration for the workspace for both unittest and pytest (plus any other test runners supported in future) - I don't think that's going to be easy to maintain. Plus the addition / deletion of__init__.py files play a significant part in test discovery despite not being covered by the test configuration pattern - so this solution would be incomplete.

Another alternative would be to accept a parent directory and only include python files from that directory + subdirectories (using workspace directory as default value). This avoids introducing a glob configuration value, but feels very limiting.

@soceanainnsoceanainnforce-pushed theseamus/avoid-eager-test-refresh-for-non-test-files branch fromc61bbd7 to564eacfCompareJanuary 17, 2025 19:55
@soceanainnsoceanainnforce-pushed theseamus/avoid-eager-test-refresh-for-non-test-files branch from564eacf tob5c1b48CompareJanuary 17, 2025 19:57
@soceanainn
Copy link
Author

@microsoft-github-policy-service agree

@eleanorjboyd
Copy link
Member

Hi@soceanainn, apologies for the delay! Think this is a great add but will need to discuss with the team about the settings add- I will get back to you soon! Thanks

@soceanainn
Copy link
Author

Thanks@eleanorjboyd !

I think it's missing 'skip package*.json' label (and any other relevant labels) which I don't have permissions to add, but otherwise should be good to go from a CI perspective.

It would be good to try to get this in ASAP, as VsCode is borderline unusable on our project withautoTestDiscoverOnSaveEnabled enabled (multiple devs reporting freezing on save when test discovery kicks in). We have something like ~40K tests in the project.

@karthiknadigkarthiknadig added feature-requestRequest for new features or functionality skip package*.jsonpackage.json and package-lock.json don't both need updating labelsFeb 14, 2025
@eleanorjboydeleanorjboyd added the skip testsUpdates to tests unnecessary labelFeb 14, 2025
@eleanorjboyd
Copy link
Member

yes will merge it today after getting additional approval from a coworker. Will also need to change the glob pattern to**/*.py as default since I think this will work for any python file regardless of if its in a subdirectory etc so Ill make that edit too

karthiknadig
karthiknadig previously approved these changesFeb 14, 2025
@karthiknadigkarthiknadig merged commit08e228d intomicrosoft:mainFeb 14, 2025
46 checks passed
@eleanorjboyd
Copy link
Member

@soceanainn now that this is merged it will be on the next version of the python extension pre-release (which will come out monday morning). If you are able to give it a try and let me know if it works as intended that would be great!

soceanainn reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@karthiknadigkarthiknadigkarthiknadig approved these changes

@eleanorjboydeleanorjboydeleanorjboyd approved these changes

Assignees

@eleanorjboydeleanorjboyd

Labels
feature-requestRequest for new features or functionalityskip package*.jsonpackage.json and package-lock.json don't both need updatingskip testsUpdates to tests unnecessary
Projects
None yet
Milestone
February 2025
Development

Successfully merging this pull request may close these issues.

AddautoTestDiscoverOnSavePattern setting to filter when discovery is run
3 participants
@soceanainn@eleanorjboyd@karthiknadig

[8]ページ先頭

©2009-2025 Movatter.jp