Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for imagetools inspect #2298

Merged
merged 3 commits into from
Mar 15, 2024

Conversation

LaurentGoderre
Copy link
Member

No description provided.

@LaurentGoderre LaurentGoderre force-pushed the imagetools-inspect-tests branch 4 times, most recently from c654bcf to fcc3041 Compare March 1, 2024 20:23
Copy link

@mrjoelkamp mrjoelkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! LGTM

@LaurentGoderre LaurentGoderre force-pushed the imagetools-inspect-tests branch 2 times, most recently from 2e628dd to 638ec6c Compare March 4, 2024 17:01
@LaurentGoderre LaurentGoderre marked this pull request as ready for review March 4, 2024 17:16
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge this but overall I think it is less likely that a breakage will happen in one of these private helper functions that is unit tested and more likely that something breaks in handling inspect --format input in relation to attestations and goes unnoticed. Also, as these are private functions, they don't have a strict contract and could be modified freely (what likely requires test modification as well).

For the integration tests that check the feature, these are atm in https://github.com/docker/buildx/blob/v0.13/tests/imagetools.go . As this PR also tests images that can't be built with buildx, it makes it trickier as for that the integration test would need to manually push such an image from raw manifest objects.

util/imagetools/imagetools_helpers_test.go Outdated Show resolved Hide resolved
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
@LaurentGoderre
Copy link
Member Author

@tonistiigi I kept the test pretty high level so they shouldn't be high maintenance. Our team is also proposing a new way to do signature of SBOM so having these tests will be helpful down the line

@tonistiigi tonistiigi merged commit 520dc59 into docker:master Mar 15, 2024
63 checks passed
@LaurentGoderre LaurentGoderre deleted the imagetools-inspect-tests branch March 25, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants