use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithLaunchScript.
@TestTemplate
void buildsImageWithLaunchScript() 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);
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithBinding.
@TestTemplate
void buildsImageWithBinding() throws IOException {
writeMainClass();
writeLongNameResource();
writeCertificateBindingFiles();
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("binding: certificates/type=ca-certificates");
assertThat(result.getOutput()).contains("binding: certificates/test1.crt=---certificate one---");
assertThat(result.getOutput()).contains("binding: certificates/test2.crt=---certificate two---");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages(projectName);
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithNetworkModeNone.
@TestTemplate
void buildsImageWithNetworkModeNone() 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("Network status: curl failed");
assertThat(result.getOutput()).contains("---> Test Info buildpack done");
removeImages(projectName);
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class BootBuildImageIntegrationTests method buildsImageWithBuildpackFromTarGzip.
@TestTemplate
@DisabledOnOs(OS.WINDOWS)
void buildsImageWithBuildpackFromTarGzip() throws IOException {
writeMainClass();
writeLongNameResource();
writeBuildpackContent();
tarGzipBuildpackContent();
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("---> Hello World buildpack");
removeImages(projectName);
}
use of org.gradle.testkit.runner.BuildResult in project spring-boot by spring-projects.
the class PackagingDocumentationTests method bootBuildImageWithCaches.
@TestTemplate
void bootBuildImageWithCaches() {
BuildResult result = this.gradleBuild.script("src/docs/gradle/packaging/boot-build-image-caches").build("bootBuildImageCaches");
assertThat(result.getOutput()).containsPattern("buildCache=cache-gradle-[\\d]+.build").containsPattern("launchCache=cache-gradle-[\\d]+.launch");
}
Aggregations