Skip to content

Commit

Permalink
understand order of execution on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeddada1 committed Jun 14, 2024
1 parent e7a51d8 commit d92123d
Showing 1 changed file with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public void tearDown() throws IOException, InterruptedException {
public void testBasic_helloWorld()
throws InvalidImageReferenceException, InterruptedException, CacheDirectoryCreationException,
IOException, RegistryException, ExecutionException {
System.out.println("testBasic_helloWorld()");
String toImage = dockerHost + ":5000/basic-helloworld";
JibContainer jibContainer =
Jib.from(dockerHost + ":5000/busybox")
Expand All @@ -133,6 +134,7 @@ public void testBasic_helloWorld()
public void testBasic_dockerDaemonBaseImage()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testBasic_dockerDaemonBaseImage()");
String toImage = dockerHost + ":5000/basic-dockerdaemon";
JibContainer jibContainer =
Jib.from("docker://" + dockerHost + ":5000/busybox")
Expand All @@ -150,6 +152,7 @@ public void testBasic_dockerDaemonBaseImage()
public void testBasic_dockerDaemonBaseImageToDockerDaemon()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testBasic_dockerDaemonBaseImageToDockerDaemon()");
String toImage = dockerHost + ":5000/docker-to-docker";
Jib.from(DockerDaemonImage.named(dockerHost + ":5000/busybox"))
.setEntrypoint("echo", "Hello World")
Expand All @@ -164,6 +167,8 @@ public void testBasic_dockerDaemonBaseImageToDockerDaemon()
public void testBasic_tarBaseImage_dockerSavedCommand()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testBasic_tarBaseImage_dockerSavedCommand()");

Path path = temporaryFolder.getRoot().toPath().resolve("docker-save.tar");
new Command("docker", "save", dockerHost + ":5000/busybox", "-o=" + path).run();

Expand All @@ -184,6 +189,8 @@ public void testBasic_tarBaseImage_dockerSavedCommand()
public void testBasic_tarBaseImage_dockerSavedFile()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException, URISyntaxException {
System.out.println("testBasic_tarBaseImage_dockerSavedFile()");

// tar saved with 'docker save busybox -o busybox.tar'
Path path = Paths.get(Resources.getResource("core/busybox-docker.tar").toURI());

Expand All @@ -203,6 +210,8 @@ public void testBasic_tarBaseImage_dockerSavedFile()
public void testBasic_tarBaseImage_jibImage()
throws InvalidImageReferenceException, InterruptedException, ExecutionException,
RegistryException, CacheDirectoryCreationException, IOException, URISyntaxException {
System.out.println("testBasic_tarBaseImage_jibImage()");

Path outputPath = temporaryFolder.getRoot().toPath().resolve("jib-image.tar");
Jib.from(dockerHost + ":5000/busybox")
.addLayer(
Expand All @@ -227,6 +236,8 @@ public void testBasic_tarBaseImage_jibImage()
public void testBasic_tarBaseImage_jibImageToDockerDaemon()
throws InvalidImageReferenceException, InterruptedException, ExecutionException,
RegistryException, CacheDirectoryCreationException, IOException, URISyntaxException {
System.out.println("testBasic_tarBaseImage_jibImageToDockerDaemon()");

// tar saved with Jib.from("busybox").addLayer(...("core/hello")).containerize(TarImage.at...)
Path path = Paths.get(Resources.getResource("core/busybox-jib.tar").toURI());

Expand All @@ -247,6 +258,8 @@ public void testBasic_tarBaseImage_jibImageToDockerDaemon()
public void testScratch_defaultPlatform()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
System.out.println("testScratch_defaultPlatform()");

Jib.fromScratch()
.containerize(
Containerizer.to(RegistryImage.named(dockerHost + ":5000/jib-scratch:default-platform"))
Expand All @@ -270,6 +283,8 @@ public void testScratch_defaultPlatform()
public void testScratch_singlePlatform()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
System.out.println("testScratch_singlePlatform()");

Jib.fromScratch()
.setPlatforms(ImmutableSet.of(new Platform("arm64", "windows")))
.containerize(
Expand All @@ -294,6 +309,8 @@ public void testScratch_singlePlatform()
public void testScratch_multiPlatform()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
System.out.println("testScratch_multiPlatform()");

Jib.fromScratch()
.setPlatforms(
ImmutableSet.of(new Platform("arm64", "windows"), new Platform("amd32", "windows")))
Expand All @@ -319,6 +336,8 @@ public void testScratch_multiPlatform()
public void testBasic_jibImageToDockerDaemon()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testBasic_jibImageToDockerDaemon()");

String toImage = dockerHost + ":5000/docker-to-docker";
Jib.from(DockerDaemonImage.named(dockerHost + ":5000/busybox"))
.setEntrypoint("echo", "Hello World")
Expand All @@ -330,9 +349,11 @@ public void testBasic_jibImageToDockerDaemon()
}

@Test
public void testBasic_jibImageToDockerDaemon_arm64()
public void testBasic_jibImageToDockerDaemon_arm64BaseImage()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testBasic_jibImageToDockerDaemon_arm64BaseImage() 2");

// Use arm64v8/busybox as base image.
String toImage = dockerHost + ":5000/docker-daemon-mismatched-arch";
Jib.from(
Expand All @@ -355,6 +376,8 @@ public void testBasic_jibImageToDockerDaemon_arm64()
public void testBasicMultiPlatform_toDockerDaemon()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
System.out.println("testBasicMultiPlatform_toDockerDaemon()");

String toImage = dockerHost + ":5000/docker-daemon-multi-platform";
Jib.from(
RegistryImage.named(
Expand All @@ -374,6 +397,9 @@ public void testBasicMultiPlatform_toDockerDaemon()
public void testBasicMultiPlatform_toDockerDaemon_pickFirstPlatformWhenNoMatchingImage()
throws IOException, InterruptedException, InvalidImageReferenceException,
CacheDirectoryCreationException, ExecutionException, RegistryException {
System.out.println(
"testBasicMultiPlatform_toDockerDaemon_pickFirstPlatformWhenNoMatchingImage()");

String toImage = dockerHost + ":5000/docker-daemon-multi-plat-mismatched-configs";
Jib.from(
RegistryImage.named(
Expand All @@ -396,6 +422,8 @@ public void testBasicMultiPlatform_toDockerDaemon_pickFirstPlatformWhenNoMatchin
public void testDistroless_ociManifest()
throws IOException, InterruptedException, ExecutionException, RegistryException,
CacheDirectoryCreationException, InvalidImageReferenceException {
System.out.println("testDistroless_ociManifest()");

Jib.from("gcr.io/distroless/base@" + KNOWN_OCI_INDEX_SHA)
.setPlatforms(
ImmutableSet.of(new Platform("arm64", "linux"), new Platform("amd64", "linux")))
Expand Down Expand Up @@ -423,6 +451,8 @@ public void testDistroless_ociManifest()
public void testOffline()
throws IOException, InterruptedException, InvalidImageReferenceException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testOffline");

Path cacheDirectory = temporaryFolder.getRoot().toPath();

JibContainerBuilder jibContainerBuilder =
Expand Down Expand Up @@ -474,6 +504,8 @@ public void testOffline()
public void testProvidedExecutorNotDisposed()
throws InvalidImageReferenceException, InterruptedException, CacheDirectoryCreationException,
IOException, RegistryException, ExecutionException {
System.out.println("testProvidedExecutorNotDisposed");

ExecutorService executorService = Executors.newCachedThreadPool();
try {
Jib.fromScratch()
Expand All @@ -491,6 +523,8 @@ public void testProvidedExecutorNotDisposed()
public void testManifestListReferenceByShaDoesNotFail()
throws InvalidImageReferenceException, IOException, InterruptedException, ExecutionException,
RegistryException, CacheDirectoryCreationException {
System.out.println("testManifestListReferenceByShaDoesNotFail()");

Containerizer containerizer =
Containerizer.to(TarImage.at(temporaryFolder.newFile("goose").toPath()).named("whatever"));

Expand Down

0 comments on commit d92123d

Please sign in to comment.