-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ci: update integration tests that expect docker manifest format from distroless image #3965
Conversation
…eneric manifest template
465278a
to
ab1697a
Compare
…e more generic manifest template" This reverts commit ab1697a.
Assert.assertEquals(2, manifestTargeted.getSchemaVersion()); | ||
// Ensures call to image at KNOWN_OCI_INDEX_SHA returns an OCI index | ||
OciIndexTemplate manifestListTargeted = | ||
registryClient.pullManifest(KNOWN_OCI_INDEX_SHA, OciIndexTemplate.class).getManifest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alt: instead of KNOWN_OCI_INDEX_SHA
, this newly added test can keep using the "latest" tag (which keeps it susceptible for breakage but able to detect future changes in this image, as noted in #3963 (comment)).
...integration-test/java/com/google/cloud/tools/jib/registry/ManifestPullerIntegrationTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @emmileaf! Left some minor comments but otherwise LGTM!
...integration-test/java/com/google/cloud/tools/jib/registry/ManifestPullerIntegrationTest.java
Show resolved
Hide resolved
Assert.assertEquals(2, manifestListTargeted.getSchemaVersion()); | ||
Assert.assertTrue((manifestListTargeted.getManifests().size() > 0)); | ||
|
||
// Generic call to image at KNOWN_OCI_INDEX_SHA, should also return an OCI index | ||
ManifestTemplate manifestListGeneric = | ||
registryClient.pullManifest(KNOWN_OCI_INDEX_SHA).getManifest(); | ||
Assert.assertEquals(2, manifestListGeneric.getSchemaVersion()); | ||
MatcherAssert.assertThat(manifestListGeneric, CoreMatchers.instanceOf(OciIndexTemplate.class)); | ||
Assert.assertTrue(((OciIndexTemplate) manifestListGeneric).getManifests().size() > 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Perhaps we can use Truth here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mpeddada1 Thanks for the suggestion! Updated assertions across this file to use Truth.assertThat
where applicable.
@@ -80,31 +112,41 @@ public void testPull_v22ManifestList() throws IOException, RegistryException { | |||
RegistryClient.factory(EventHandlers.NONE, "gcr.io", "distroless/base", httpClient) | |||
.newRegistryClient(); | |||
|
|||
// Ensure ":latest" is a manifest list | |||
// Ensures call to image at KNOWN_MANIFEST_LIST_SHA returns a manifest list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: how about we say something like "at the specified sha`? This can prevent the comment from becoming stale if the variable name changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, updated!
Kudos, SonarCloud Quality Gate passed! |
Fixes #3963 to unblock CI (See issue for more error details and discussion).
Changes in this PR to address manifest format change in latest distroless image:
BlobCheckerIntegrationTest
andBlobPullerIntegrationTest
by using a fixed older version of the distroless imageManifestPullerIntegrationTest
, and extends it to specifically cover OCI format using pinned image versions