Add test coverage for cache staleness detection functions#4
Merged
Kadajett merged 3 commits intofeature/sem-45from Dec 5, 2025
Merged
Add test coverage for cache staleness detection functions#4Kadajett merged 3 commits intofeature/sem-45from
Kadajett merged 3 commits intofeature/sem-45from
Conversation
- Added tests for is_layer_stale with missing layers - Added tests for is_base_layer_stale with missing indexed SHA - Added tests for is_branch_layer_stale with missing indexed SHA - Added tests for is_working_layer_stale with no files, deleted files, modified files, and unmodified files - Added git integration tests for base layer staleness when HEAD changes - Added git integration tests for branch layer staleness when HEAD moves - Added git integration tests for branch layer staleness when merge-base changes (rebase scenarios) - Added edge case tests for missing git refs - Added edge case tests for detached HEAD scenarios - Added tests for is_layer_stale dispatching to correct functions - Added tests for is_layered_index_stale with no cache and stale base layer All 15 new tests pass along with existing 147 tests (162 total). Co-authored-by: Kadajett <3784716+Kadajett@users.noreply.github.com>
- Extract magic number to named constant FUTURE_OFFSET_SECONDS - Improve assertion clarity in edge case test with match pattern Co-authored-by: Kadajett <3784716+Kadajett@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback on overlay layer architecture cache integration
Add test coverage for cache staleness detection functions
Dec 5, 2025
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.
The staleness detection functions (
is_layer_stale,is_base_layer_stale,is_branch_layer_stale,is_working_layer_stale) lacked test coverage for critical cache invalidation logic.Changes
Basic staleness scenarios:
Working layer staleness:
Git integration scenarios:
Edge cases:
All tests use real git repositories to validate actual git workflows (commits, branches, rebases) rather than mocking.
Example
15 new tests added, all passing (162 total).
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.