Update spring-boot-loader-classic-tests to use docker-test plugin

See gh-41228
This commit is contained in:
Andy Wilkinson 2024-06-25 12:17:54 +01:00
parent edc582800b
commit 6564abb12a
8 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
plugins { plugins {
id "java" id "java"
id "org.springframework.boot.conventions" id "org.springframework.boot.conventions"
id "org.springframework.boot.integration-test" id "org.springframework.boot.docker-test"
} }
description = "Spring Boot Classic Loader Integration Tests" description = "Spring Boot Classic Loader Integration Tests"
@ -15,16 +15,16 @@ dependencies {
app project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository") app project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository")
app project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web", configuration: "mavenRepository") app project(path: ":spring-boot-project:spring-boot-starters:spring-boot-starter-web", configuration: "mavenRepository")
intTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent"))) dockerTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
intTestImplementation("org.testcontainers:junit-jupiter") dockerTestImplementation("org.testcontainers:junit-jupiter")
intTestImplementation("org.testcontainers:testcontainers") dockerTestImplementation("org.testcontainers:testcontainers")
} }
task syncMavenRepository(type: Sync) { task syncMavenRepository(type: Sync) {
from configurations.app from configurations.app
into "${buildDir}/int-test-maven-repository" into "${buildDir}/docker-test-maven-repository"
} }
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) { task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
@ -39,6 +39,6 @@ task buildApp(type: GradleBuild) {
tasks = ["build"] tasks = ["build"]
} }
intTest { tasks.named("dockerTest").configure {
dependsOn buildApp dependsOn buildApp
} }

View File

@ -6,7 +6,7 @@ plugins {
apply plugin: "io.spring.dependency-management" apply plugin: "io.spring.dependency-management"
repositories { repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"} maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral() mavenCentral()
maven { url "https://repo.spring.io/snapshot" } maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" } maven { url "https://repo.spring.io/milestone" }

View File

@ -1,6 +1,6 @@
pluginManagement { pluginManagement {
repositories { repositories {
maven { url "file:${rootDir}/../int-test-maven-repository"} maven { url "file:${rootDir}/../docker-test-maven-repository"}
mavenCentral() mavenCentral()
maven { url "https://repo.spring.io/snapshot" } maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" } maven { url "https://repo.spring.io/milestone" }

View File

@ -130,7 +130,7 @@ class LoaderIntegrationTests {
String arch = System.getProperty("os.arch"); String arch = System.getProperty("os.arch");
String dockerFile = ("aarch64".equals(arch)) ? "Dockerfile-aarch64" : "Dockerfile"; String dockerFile = ("aarch64".equals(arch)) ? "Dockerfile-aarch64" : "Dockerfile";
ImageFromDockerfile image = new ImageFromDockerfile("spring-boot-loader/oracle-jdk-17") ImageFromDockerfile image = new ImageFromDockerfile("spring-boot-loader/oracle-jdk-17")
.withFileFromFile("Dockerfile", new File("src/intTest/resources/conf/oracle-jdk-17/" + dockerFile)); .withFileFromFile("Dockerfile", new File("src/dockerTest/resources/conf/oracle-jdk-17/" + dockerFile));
return new JavaRuntime("Oracle JDK 17", JavaVersion.SEVENTEEN, () -> new GenericContainer<>(image)); return new JavaRuntime("Oracle JDK 17", JavaVersion.SEVENTEEN, () -> new GenericContainer<>(image));
} }