Skip to content

Add tests for imagetools inspect#2298

Merged
tonistiigi merged 3 commits intodocker:masterfrom
LaurentGoderre:imagetools-inspect-tests
Mar 15, 2024
Merged

Add tests for imagetools inspect#2298
tonistiigi merged 3 commits intodocker:masterfrom
LaurentGoderre:imagetools-inspect-tests

Conversation

@LaurentGoderre
Copy link
Copy Markdown
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
Copy Markdown

@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
@LaurentGoderre LaurentGoderre force-pushed the imagetools-inspect-tests branch from 638ec6c to f96c50c Compare March 5, 2024 18:10
@LaurentGoderre LaurentGoderre force-pushed the imagetools-inspect-tests branch from f96c50c to fa006f6 Compare March 5, 2024 18:15
Copy link
Copy Markdown
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.

Comment thread util/imagetools/imagetools_helpers_test.go Outdated
@LaurentGoderre LaurentGoderre force-pushed the imagetools-inspect-tests branch from fa006f6 to abff444 Compare March 5, 2024 18:56
@LaurentGoderre
Copy link
Copy Markdown
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
@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