-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Context
In PR #9051, we added comprehensive E2E tests for the shared resolver cache across bundle, git, and cluster resolvers. However, there is significant duplication in test patterns across these resolver types.
Task
Refactor the E2E tests in test/resolver_cache_test.go to reduce redundancy while maintaining coverage.
Current State
The test file contains 15 tests, many of which follow similar patterns:
- TestBundleResolverCache
- TestBundleResolverCacheEviction
- TestBundleResolverCacheTTL
- TestGitResolverCache
- TestGitResolverCacheEviction
- TestGitResolverCacheTTL
- TestClusterResolverCache
- TestClusterResolverCacheEviction
- TestClusterResolverCacheTTL
Proposed Solution
- Extract common test patterns into helper functions
- Consider table-driven tests that can test all resolver types with the same logic
- Maintain full coverage while reducing code duplication
- Keep resolver-specific tests only where behavior actually differs
Files to Modify
test/resolver_cache_test.go
References
- Original PR: feat: implement shared cache for bundle, git, and cluster resolvers #9051
- Feedback from @twoGiants requesting this refactoring
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done