Skip to content

[CI] Include nested imports in find_dependent_tests import scan - #1260

Open
aniruddhaadak80 wants to merge 1 commit into
fla-org:mainfrom
aniruddhaadak80:fix/dependent-tests-nested-imports
Open

aniruddhaadak80 wants to merge 1 commit into
fla-org:mainfrom
aniruddhaadak80:fix/dependent-tests-nested-imports

Conversation

@aniruddhaadak80

Copy link
Copy Markdown

Summary

get_imports_from_tree in scripts/find_dependent_tests.py only scanned tree.body, so imports inside functions, methods, try/except, or TYPE_CHECKING blocks were invisible to CI test selection. A real example is tests/modules/test_conv.py:837, which lazily imports fast_causal_conv1d_fn inside test_fast_conv_varlen. This PR scans with ast.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

  • Repro script (stdlib only): get_imports_from_tree on a snippet with a function-level from fla.ops.gla import chunk_gla and a try:-block import fla.utils returned an empty set before the fix and returns both imports after; top-level imports are unchanged.
  • End-to-end run: python scripts/find_dependent_tests.py fla/ops/utils/pack.py still correctly resolves tests/ops/utils/test_pack.py.
  • ruff check and py_compile clean on the touched file.
  • Varlen / CP / model tests: N/A, CI-tooling change only; correctness is covered by the selection behavior above and CI runs on this PR.

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

  • I have read CONTRIBUTING.md and follow its conventions (code style, docstrings, commit prefixes).
  • I have read AGENTS.md and, where my change matches its scope, the relevant skill under .agents/skills.
  • Dependent tests pass locally or in CI, and new behavior is covered by tests where applicable (tick as N/A for changes with no testable code, e.g. docs-only).
  • Kernel changes include same-hardware before/after benchmark numbers, dense + varlen where applicable (tick as N/A when no kernel code changed).
  • This PR is minor/cosmetic-only (typo, formatting, style-only tweaks) — tick only if it is, and justify below.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant