Skip to content

feat(make): add smart test target that only tests changed components#308

Merged
DorianZheng merged 2 commits intomainfrom
fix/smart-test-detect-changes
Feb 26, 2026
Merged

feat(make): add smart test target that only tests changed components#308
DorianZheng merged 2 commits intomainfrom
fix/smart-test-detect-changes

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Add detect_changes function to make/test.mk that diffs against main (or HEAD~1 on main) to identify which components changed (committed, staged, and unstaged)
  • make test now runs only relevant test suites instead of the full matrix, mapping changed paths to component tags (rust, cli, ffi, python, node, c)
  • Uses $(sort) for deduplication when multiple paths map to the same component (e.g. boxlite/ and boxlite-shared/ both → rust)
  • Narrows pre-commit lint hook to only trigger on source file changes instead of always_run

Test plan

  • Verified unmatched paths produce no component output
  • Verified Cargo.toml/Cargo.lock changes map to rust cli ffi
  • Verified feature branch detection via merge-base
  • Verified multi-component detection (boxlite/ + sdks/python/python rust)
  • Verified deduplication (boxlite/ + boxlite-shared/ → single rust, not rust rust)
  • Verified make test:all still runs the full matrix

Add detect_changes function that diffs against main (or HEAD~1 on
main) to identify changed components, then runs only relevant test
suites. Uses $(sort) for deduplication. Also narrows pre-commit lint
hook to only trigger on source file changes.
Extract detect_changes into shared make/changes.mk and derive
FMT_COMPONENTS (cli/ffi → rust normalization). fmt, fmt:check, and
lint now skip unchanged surfaces. fmt:all, fmt:check:all, lint:all
provide unconditional full runs.
@DorianZheng DorianZheng merged commit f8fbd59 into main Feb 26, 2026
9 checks passed
@DorianZheng DorianZheng deleted the fix/smart-test-detect-changes branch February 26, 2026 09:37
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