[Test Improver] test: add unit tests for BaseIntegrator utility methods#585
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
[Test Improver] test: add unit tests for BaseIntegrator utility methods#585danielmeppiel wants to merge 1 commit intomainfrom
danielmeppiel wants to merge 1 commit intomainfrom
Conversation
Cover 4 methods with zero existing tests: - normalize_managed_files(): path sep normalization + dedup - cleanup_empty_parents(): bottom-up dir removal after sync - sync_remove_files(): manifest-based file removal + legacy glob fallback - find_files_by_glob(): package file discovery with subdir support 32 new tests, all passing. No production code changed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Overview
Goal: Cover 4
BaseIntegratorutility methods that had zero direct test coverage. These methods are called by every file-level integrator (skills, prompts, hooks, agents, instructions) and are critical for correct sync behaviour across platforms.Methods covered:
normalize_managed_files()cleanup_empty_parents()sync_remove_files()find_files_by_glob()Rationale
These methods form the core of APM's install/uninstall sync pipeline. Without direct tests:
sync_remove_fileshas never been exercised by testssync_remove_files(traversal path rejection) is untestedTest cases added
TestNormalizeManagedFiles(8 tests): None passthrough, empty set, forward-slash no-op, backslash conversion, mixed separators, immutability, deduplication after normalization, large set.TestCleanupEmptyParents(7 tests): Empty list no-op, removes empty intermediate dirs, preserves stop_at, preserves non-empty dirs, multiple files in same dir, deeply nested cleanup, boundary stop.TestSyncRemoveFiles(9 tests): Removes matching files, skips non-prefix files, skips missing files, legacy glob fallback, missing glob dir, multiple files, traversal path rejection, invalid prefix, missing glob pattern.TestFindFilesByGlob(8 tests): Finds matches, empty result, nonexistent dir, subdir search, deduplication across dirs, combined root+subdir, missing subdir, sorted results.Coverage impact
normalize_managed_filescleanup_empty_parentssync_remove_filesfind_files_by_globTest status
Reproducibility
🤖 Test Improver - automated AI assistant. Review before merging.