Skip to content

Commit a9f26e0

Browse files
Conditionally enable image building bind cache tests
Accessing bind mount directories as is done in the tests for building images with bind mount caches requires Docker configuration when using Docker Desktop. It works without configuration on Linux with Docker Engine. See gh-28387
1 parent 291d410 commit a9f26e0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImageIntegrationTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.gradle.testkit.runner.BuildResult;
3838
import org.gradle.testkit.runner.TaskOutcome;
3939
import org.junit.jupiter.api.TestTemplate;
40+
import org.junit.jupiter.api.condition.EnabledOnOs;
4041
import org.junit.jupiter.api.condition.OS;
4142

4243
import org.springframework.boot.buildpack.platform.docker.DockerApi;
@@ -299,6 +300,8 @@ void buildsImageWithVolumeCaches() throws IOException {
299300
}
300301

301302
@TestTemplate
303+
@EnabledOnOs(value = OS.LINUX, disabledReason = "Works with Docker Engine on Linux but is not reliable with "
304+
+ "Docker Desktop on other OSs")
302305
void buildsImageWithBindCaches() throws IOException {
303306
writeMainClass();
304307
writeLongNameResource();

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildImageTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.stream.IntStream;
2727

2828
import org.junit.jupiter.api.TestTemplate;
29+
import org.junit.jupiter.api.condition.EnabledOnOs;
2930
import org.junit.jupiter.api.condition.OS;
3031
import org.junit.jupiter.api.extension.ExtendWith;
3132

@@ -400,6 +401,8 @@ void whenBuildImageIsInvokedWithVolumeCaches(MavenBuild mavenBuild) {
400401
}
401402

402403
@TestTemplate
404+
@EnabledOnOs(value = OS.LINUX, disabledReason = "Works with Docker Engine on Linux but is not reliable with "
405+
+ "Docker Desktop on other OSs")
403406
void whenBuildImageIsInvokedWithBindCaches(MavenBuild mavenBuild) {
404407
String testBuildId = randomString();
405408
mavenBuild.project("build-image-bind-caches")

0 commit comments

Comments
 (0)