-
Task
-
Resolution: Done
-
Normal
-
None
-
None
-
None
-
None
-
False
-
-
False
-
None
-
None
-
None
-
None
-
None
In commit 2c734e72a, TestGetDigest and TestGetManifest were removed from support/util/imagemetadata_test.go because they made real HTTP calls to quay.io, violating unit testing principles. While removing them was correct to unblock CI, the code paths exercised by those tests (GetDigest, GetManifest, cache behavior, override fallback) are no longer covered by any unit test.
Re-add the tests using mockgen-generated mocks for distribution.Repository and distribution.TagService so that no network calls are made and digests are deterministic.
Implementation approach:
- Add injectable repoSetupFn field to RegistryClientImageMetadataProvider
- Add go:generate directive for mockgen following existing convention in support/releaseinfo/releaseinfo.go
- Rewrite tests using gomock MockRepository and MockTagService
- Clear digestCache and manifestsCache between test cases for isolation
Reference: https://github.com/openshift/hypershift/commit/2c734e72a5b96473ee4ca18d98c042d857ad0a2f