feat(make): add smart test target that only tests changed components#308
Merged
DorianZheng merged 2 commits intomainfrom Feb 26, 2026
Merged
feat(make): add smart test target that only tests changed components#308DorianZheng merged 2 commits intomainfrom
DorianZheng merged 2 commits intomainfrom
Conversation
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.
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
detect_changesfunction tomake/test.mkthat diffs against main (or HEAD~1 on main) to identify which components changed (committed, staged, and unstaged)make testnow runs only relevant test suites instead of the full matrix, mapping changed paths to component tags (rust, cli, ffi, python, node, c)$(sort)for deduplication when multiple paths map to the same component (e.g.boxlite/andboxlite-shared/both →rust)always_runTest plan
Cargo.toml/Cargo.lockchanges map torust cli ffiboxlite/+sdks/python/→python rust)boxlite/+boxlite-shared/→ singlerust, notrust rust)make test:allstill runs the full matrix