Problem or motivation
The internal/enricher package has no test files. It implements Enrich, enrichModel, enrichDataset, applyRefetchedMetadata, and refetchMetadata — the core logic for both interactive and file-based AIBOM enrichment. This is a high-complexity, user-facing code path that handles field selection, viper config parsing, HF API refetching, and BOM mutation. Zero test coverage means regressions in enrichment logic are undetectable without manual testing.
Proposed solution
Add internal/enricher/enricher_test.go covering at minimum:
Enrich with strategy: "file" using a test viper instance with known field values — verify the correct fields are set on the output BOM
Enrich with a nil BOM — verify error is returned
Enrich with Refetch: false — verify no API calls are made
applyRefetchedMetadata with a valid ModelAPIResponse — verify fields are applied to the BOM
enrichModel with RequiredOnly: true — verify only required fields are presented
Use the existing fetcher.DummyModelAPIFetcher and fetcher.DummyModelReadmeFetcher for HF call injection.
Alternatives considered
None — this is a straightforward gap to fill with unit tests.
Additional context
Affected directory: internal/enricher/. The interactive.go and preview.go files in the same package also have no tests.
Problem or motivation
The
internal/enricherpackage has no test files. It implementsEnrich,enrichModel,enrichDataset,applyRefetchedMetadata, andrefetchMetadata— the core logic for both interactive and file-based AIBOM enrichment. This is a high-complexity, user-facing code path that handles field selection, viper config parsing, HF API refetching, and BOM mutation. Zero test coverage means regressions in enrichment logic are undetectable without manual testing.Proposed solution
Add
internal/enricher/enricher_test.gocovering at minimum:Enrichwithstrategy: "file"using a test viper instance with known field values — verify the correct fields are set on the output BOMEnrichwith a nil BOM — verify error is returnedEnrichwithRefetch: false— verify no API calls are madeapplyRefetchedMetadatawith a validModelAPIResponse— verify fields are applied to the BOMenrichModelwithRequiredOnly: true— verify only required fields are presentedUse the existing
fetcher.DummyModelAPIFetcherandfetcher.DummyModelReadmeFetcherfor HF call injection.Alternatives considered
None — this is a straightforward gap to fill with unit tests.
Additional context
Affected directory:
internal/enricher/. Theinteractive.goandpreview.gofiles in the same package also have no tests.