use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithVolumeCaches.
@TestTemplate
void buildsImageWithVolumeCaches() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages(projectName);
deleteVolumes("cache-" + projectName + ".build", "cache-" + projectName + ".launch");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithCommandLineOptions.
@TestTemplate
void buildsImageWithCommandLineOptions() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT", "--imageName=example/test-image-cmd", "--builder=projects.registry.vmware.com/springboot/spring-boot-cnb-builder:0.0.1", "--runImage=projects.registry.vmware.com/springboot/run:tiny-cnb");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-cmd");
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages("example/test-image-cmd");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method failsWithBuilderError.
@TestTemplate
void failsWithBuilderError() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.buildAndFail("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.FAILED);
assertThat(result.getOutput()).contains("Forced builder failure");
assertThat(result.getOutput()).containsPattern("Builder lifecycle '.*' failed with status code");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithCustomBuilderAndRunImage.
@TestTemplate
void buildsImageWithCustomBuilderAndRunImage() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("example/test-image-custom");
assertThat(result.getOutput()).contains("---> Test Info buildpack building");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages("example/test-image-custom");
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithBuildpackFromBuilder.
@TestTemplate
void buildsImageWithBuildpackFromBuilder() throws IOException {
writeMainClass();
writeLongNameResource();
BuildResult result = this.gradleBuild.build("bootBuildImage", "--pullPolicy=IF_NOT_PRESENT");
String projectName = this.gradleBuild.getProjectDir().getName();
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(result.getOutput()).contains("docker.io/library/" + projectName);
assertThat(result.getOutput()).contains("---> Test Info buildpack building").contains("---> Test Info buildpack done");
removeImages(projectName);
}
Aggregations