[Test Improver] test: add unit tests for BaseIntegrator utility methods#577
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
[Test Improver] test: add unit tests for BaseIntegrator utility methods#577danielmeppiel wants to merge 1 commit intomainfrom
danielmeppiel wants to merge 1 commit intomainfrom
Conversation
Add direct unit tests for BaseIntegrator methods that were exercised only indirectly through subclass integration tests: - cleanup_empty_parents: empty-list noop, bottom-up removal, stop_at boundary, sibling preservation, nonexistent path handling - find_files_by_glob: pattern matching, subdir search, deduplication, missing-path safety, sorted output - normalize_managed_files: None passthrough, backslash normalization - check_collision (diagnostics path): diagnostics.skip() called instead of _rich_warning when diagnostics object provided - resolve_links / init_link_resolver: no-resolver path, zero-count when content unchanged, link-count computation, exception handling 30 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.
Summary
This PR adds direct unit tests for
BaseIntegratorutility methods insrc/apm_cli/integration/base_integrator.pythat were previously exercised only indirectly through subclass integration tests.Goal and Rationale
BaseIntegratoris the shared infrastructure for all file-level integrators (prompts, agents, skills, hooks, instructions, commands). Its utility methods are on the critical path for install, sync, and uninstall operations across every target. While these methods had indirect coverage through the many integrator subclass tests, they lacked dedicated unit tests that:cleanup_empty_parentswith nonexistent paths,find_files_by_globdeduplication,check_collisionwith a diagnostics object)Approach
New test file:
tests/unit/integration/test_base_integrator.pyTestIntegrationResultTestCleanupEmptyParentsTestFindFilesByGlobTestNormalizeManagedFilesTestCheckCollisionDiagnosticsTestResolveLinksTestShouldIntegrateCoverage Impact
No coverage tooling run (avoids PyYAML global state corruption from
--cov). All 30 new tests target previously untested code paths inbase_integrator.py.Test Status
All tests pass. No production code changed.
Reproducibility