test: add unit coverage for generated SBOM contents - #5222
Draft
gangadhar-res wants to merge 1 commit into
Draft
Conversation
✅ Deploy Preview for zarf-docs canceled.
|
The existing tests only asserted that SBOM generation produced non-empty output. Add content-level assertions against the parsed syft-json documents: - createImageSBOM: an image layer carrying an apk installed database must yield the expected packages (name, version, type apk), the zarf descriptor, a source, schema metadata and artifact relationships. - createFileSBOM: a component tar carrying a requirements.txt must yield the expected python packages, the zarf descriptor and relationships, and write the same bytes to zarf-component-<name>.json. Fixture expectations are derived from current output on main so a Syft upgrade produces a focused, reviewable diff instead of silent drift. Fixes zarf-dev#5159 Signed-off-by: Gangadhar Chalapaka <gangadhar@resolve.ai>
gangadhar-res
force-pushed
the
test/sbom-content-coverage
branch
from
August 14, 2026 06:42
0e0b959 to
c700e3b
Compare
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.
Fixes #5159
The existing SBOM tests only asserted non-empty output. This adds content-level assertions against the parsed syft-json documents:
Fixture expectations are derived from current output on main, so a Syft upgrade produces a focused, reviewable diff instead of silent drift.
Test-only change; go test ./src/pkg/packager/assemble/ green locally.