From da2276e7d4d680c90413eda166008698998a8a07 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Tue, 17 Nov 2020 13:54:10 -0600 Subject: [PATCH] Use stable builder and run images in integration tests Fixes gh-24183 --- .../bundling/BootBuildImageIntegrationTests.java | 11 +++++------ ...buildsImageWithCustomBuilderAndRunImage.gradle | 4 ++-- .../boot/maven/BuildImageTests.java | 15 ++++++--------- .../projects/build-image-custom-builder/pom.xml | 4 ++-- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java index b24beebaa44..760abdde352 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java @@ -95,8 +95,8 @@ class BootBuildImageIntegrationTests { BuildResult result = this.gradleBuild.build("bootBuildImage"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("example/test-image-custom"); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); - assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder:full"); + assertThat(result.getOutput()).contains("paketobuildpacks/run:full-cnb"); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-custom")); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -111,12 +111,11 @@ class BootBuildImageIntegrationTests { writeMainClass(); writeLongNameResource(); BuildResult result = this.gradleBuild.build("bootBuildImage", "--imageName=example/test-image-cmd", - "--builder=gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3", - "--runImage=gcr.io/paketo-buildpacks/run:full-cnb-cf"); + "--builder=paketobuildpacks/builder:full", "--runImage=paketobuildpacks/run:full-cnb"); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); assertThat(result.getOutput()).contains("example/test-image-cmd"); - assertThat(result.getOutput()).contains("paketo-buildpacks/builder:full-cf-platform-api-0.3"); - assertThat(result.getOutput()).contains("paketo-buildpacks/run:full-cnb-cf"); + assertThat(result.getOutput()).contains("paketobuildpacks/builder:full"); + assertThat(result.getOutput()).contains("paketobuildpacks/run:full-cnb"); ImageReference imageReference = ImageReference.of(ImageName.of("example/test-image-cmd")); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle index 56e5bce571d..9878fe16dbf 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests-buildsImageWithCustomBuilderAndRunImage.gradle @@ -8,6 +8,6 @@ targetCompatibility = '1.8' bootBuildImage { imageName = "example/test-image-custom" - builder = "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3" - runImage = "gcr.io/paketo-buildpacks/run:full-cnb-cf" + builder = "paketobuildpacks/builder:full" + runImage = "paketobuildpacks/run:full-cnb" } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java index 2cbb5c58b5c..807f9522b50 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java @@ -93,14 +93,12 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { void whenBuildImageIsInvokedWithCommandLineParameters(MavenBuild mavenBuild) { mavenBuild.project("build-image").goals("package") .systemProperty("spring-boot.build-image.imageName", "example.com/test/cmd-property-name:v1") - .systemProperty("spring-boot.build-image.builder", - "gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3") - .systemProperty("spring-boot.build-image.runImage", "gcr.io/paketo-buildpacks/run:full-cnb-cf") + .systemProperty("spring-boot.build-image.builder", "paketobuildpacks/builder:full") + .systemProperty("spring-boot.build-image.runImage", "paketobuildpacks/run:full-cnb") .execute((project) -> { assertThat(buildLog(project)).contains("Building image") - .contains("example.com/test/cmd-property-name:v1") - .contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") - .contains("paketo-buildpacks/run:full-cnb-cf").contains("Successfully built image"); + .contains("example.com/test/cmd-property-name:v1").contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full-cnb").contains("Successfully built image"); ImageReference imageReference = ImageReference.of("example.com/test/cmd-property-name:v1"); try (GenericContainer container = new GenericContainer<>(imageReference.toString())) { container.waitingFor(Wait.forLogMessage("Launched\\n", 1)).start(); @@ -114,9 +112,8 @@ public class BuildImageTests extends AbstractArchiveIntegrationTests { @TestTemplate void whenBuildImageIsInvokedWithCustomBuilderImageAndRunImage(MavenBuild mavenBuild) { mavenBuild.project("build-image-custom-builder").goals("package").execute((project) -> { - assertThat(buildLog(project)).contains("Building image") - .contains("paketo-buildpacks/builder:full-cf-platform-api-0.3") - .contains("paketo-buildpacks/run:full-cnb-cf") + assertThat(buildLog(project)).contains("Building image").contains("paketobuildpacks/builder:full") + .contains("paketobuildpacks/run:full-cnb") .contains("docker.io/library/build-image-v2-builder:0.0.1.BUILD-SNAPSHOT") .contains("Successfully built image"); ImageReference imageReference = ImageReference diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml index 7b37388b62e..457cb7c9337 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/projects/build-image-custom-builder/pom.xml @@ -23,8 +23,8 @@ - gcr.io/paketo-buildpacks/builder:full-cf-platform-api-0.3 - gcr.io/paketo-buildpacks/run:full-cnb-cf + paketobuildpacks/builder:full + paketobuildpacks/run:full-cnb