[CI] Include nested imports in find_dependent_tests import scan - #1260
Open
aniruddhaadak80 wants to merge 1 commit into
Open
aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_imports_from_treeinscripts/find_dependent_tests.pyonly scannedtree.body, so imports inside functions, methods,try/except, orTYPE_CHECKINGblocks were invisible to CI test selection. A real example istests/modules/test_conv.py:837, which lazily importsfast_causal_conv1d_fninsidetest_fast_conv_varlen. This PR scans withast.walk(tree)instead, consistent with the other scanners in the same file (get_backend_methods_from_dir,find_dispatch_op_files). The change is strictly additive for test selection: it can only add dependent tests, never drop any.Test plan
get_imports_from_treeon a snippet with a function-levelfrom fla.ops.gla import chunk_glaand atry:-blockimport fla.utilsreturned an empty set before the fix and returns both imports after; top-level imports are unchanged.python scripts/find_dependent_tests.py fla/ops/utils/pack.pystill correctly resolvestests/ops/utils/test_pack.py.ruff checkandpy_compileclean on the touched file.Benchmark / NCU (kernel changes only)
Neutral, no kernel code changed.
Breaking changes
None. CI may run a slightly larger (more complete) test set for PRs touching lazily-imported modules.
Checklist