[Test Improver] test: add unit tests for BaseIntegrator shared infrastructure#599
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
Conversation
Cover previously-untested methods in BaseIntegrator: - IntegrationResult dataclass (defaults and optional fields) - should_integrate() always-True guard - normalize_managed_files() backslash normalisation - cleanup_empty_parents() bottom-up empty-dir removal - sync_remove_files() manifest mode + legacy glob fallback - find_files_by_glob() discovery, deduplication, subdir support 30 new tests, all passing alongside existing suite (3704 total). 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.
🤖 Test Improver — automated AI assistant
Goal and Rationale
BaseIntegratoris the shared infrastructure layer that every file-level integrator inherits from. Several of its methods had no direct unit tests, relying only on indirect coverage from higher-level integrator tests:normalize_managed_files()— path-separator normalisation (backslash → forward slash)cleanup_empty_parents()— bottom-up empty-directory removal after uninstallsync_remove_files()— manifest-based file removal with legacy glob fallbackfind_files_by_glob()— file discovery with subdir support and deduplicationIntegrationResult— dataclass defaults and optional fieldsshould_integrate()— base guardThese are security- and correctness-critical paths.
sync_remove_filesvalidates deploy paths before removing files;cleanup_empty_parentsmust not over-delete;find_files_by_globmust reject symlinks pointing outside the package.Approach
Added
tests/unit/integration/test_base_integrator.pywith 30 focused tests:TestIntegrationResultTestShouldIntegrateTestNormalizeManagedFilesTestCleanupEmptyParentsTestSyncRemoveFilesTestFindFilesByGlobTest Status
All 30 new tests pass. Full unit suite: 3704 passed (no regressions).
Reproducibility