-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[update_lib] show dependent tests in deps subcommand
#6828
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I suggest to include it as default output, Then this is copyable to Output like current way when |
Extend find_tests_importing_module() and _build_test_import_graph() to recursively search Lib/test/test_*/ directories using **/*.py glob pattern instead of just *.py. This fixes incomplete dependency analysis that was missing test files inside module directories like test_json/, test_importlib/, etc. Changes: - Add _parse_test_submodule_imports() to handle "from test.X import Y" - Update _build_test_import_graph() with recursive glob and submodule import handling - Update find_tests_importing_module() to use relative paths and handle __init__.py files correctly - Update show_deps.py to display relative paths (e.g., test_json/test_decode.py) - Add TestFindTestsInModuleDirectories test class with 3 tests Co-Authored-By: Claude <noreply@anthropic.com>
Add consolidate_test_paths() to group test_*/ directory contents into single entries (e.g., test_sqlite3/test_dbapi.py → test_sqlite3). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Outputs space-separated test names for direct use with python3 -m test: python3 -m test $(python3 scripts/update_lib deps sqlite3 --impact-only) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove --impact flag, dependent tests are now shown by default - Rename --impact-only to --dependent-tests-only - Change output label from "[+] impact:" to "[+] dependent tests:" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Code has been automatically formatted The code in this PR has been formatted using:
git pull origin deps-impact-command |
--impact option for deps subcommanddeps subcommand
|
I've made some more modifications. However, as I noted in the PR description, the outcome isn't significantly different from a complete overhaul, so I'm questioning its effectiveness. It might be better to just close it. |
Note
I'm trying to fixing the following issue.
This pull request makes the deps subcommand show tests that depend on a given module. This is to speed up the feedback loop, as while CI does run the tests, waiting for it takes quite a long time.
Running it like
python3 scripts/update_lib deps json --dependent-tests-onlywill output just the list of tests without any verbose logs, which can then be passed directly as arguments after-m test.However, when you check with the command
ls Lib/test | grep "test_" | wc -l, there are about 342 tests in total, and even with this feature, the number only drops to around 330, so it doesn't feel very useful.With
--dependent-tests-onlyoption: