diff --git a/jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java b/jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java index dd90f4ede4..1deae3502c 100644 --- a/jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java +++ b/jib-core/src/integration-test/java/com/google/cloud/tools/jib/api/JibIntegrationTest.java @@ -423,21 +423,32 @@ public void testDistroless_ociManifest() throws IOException, InterruptedException, ExecutionException, RegistryException, CacheDirectoryCreationException, InvalidImageReferenceException { System.out.println("testDistroless_ociManifest()"); + System.out.println(Runtime.getRuntime().availableProcessors()); Jib.from("gcr.io/distroless/base@" + KNOWN_OCI_INDEX_SHA) .setPlatforms( ImmutableSet.of(new Platform("arm64", "linux"), new Platform("amd64", "linux"))) + // Pushing to registry causes next test to hang. .containerize( Containerizer.to( - DockerDaemonImage.named(dockerHost + ":6000/jib-distroless:multi-platform")) + RegistryImage.named(dockerHost + ":6000/jib-distroless:multi-platform")) .setAllowInsecureRegistries(true)); - // V22ManifestListTemplate manifestList = - // (V22ManifestListTemplate) - // distrolessRegistryClient.pullManifest("multi-platform").getManifest(); - // Assert.assertEquals(2, manifestList.getManifests().size()); - // ManifestDescriptorTemplate.Platform platform1 = - // manifestList.getManifests().get(0).getPlatform(); + String toImage = dockerHost + ":5000/docker-daemon-mismatched-arch"; + Jib.from( + RegistryImage.named( + "busybox@sha256:eb427d855f82782c110b48b9a398556c629ce4951ae252c6f6751a136e194668")) + .containerize(Containerizer.to(DockerDaemonImage.named(toImage))); + System.out.println("post-build"); + + V22ManifestListTemplate manifestList = + (V22ManifestListTemplate) + distrolessRegistryClient.pullManifest("multi-platform").getManifest(); + Assert.assertEquals(2, manifestList.getManifests().size()); + ManifestDescriptorTemplate.Platform platform1 = + manifestList.getManifests().get(0).getPlatform(); + System.out.println(platform1.getArchitecture()); + // ManifestDescriptorTemplate.Platform platform2 = // manifestList.getManifests().get(1).getPlatform(); // diff --git a/jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/LocalRegistry.java b/jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/LocalRegistry.java index c6cb6a16c8..cda1bc75c3 100644 --- a/jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/LocalRegistry.java +++ b/jib-core/src/integration-test/java/com/google/cloud/tools/jib/registry/LocalRegistry.java @@ -65,6 +65,7 @@ protected void before() throws IOException, InterruptedException { @Override protected void after() { + System.out.println("tear down"); stop(); } diff --git a/kokoro/presubmit.sh b/kokoro/presubmit.sh index 96d3acea40..837b45174f 100755 --- a/kokoro/presubmit.sh +++ b/kokoro/presubmit.sh @@ -26,4 +26,4 @@ docker kill $(docker ps --all --quiet | grep -v "$CONTAINER_ID") || true cd github/jib # we only run integration tests on jib-core for presubmit -./gradlew clean build :jib-core:integrationTest --info --stacktrace +./gradlew clean build :jib-core:integrationTest --tests "com.google.cloud.tools.jib.api.JibIntegrationTest.testDistroless_ociManifest" --info --stacktrace