Skip to content

Commit 7e4d60e

Browse files
committed
Update spring-boot-launch-script-tests to use docker-test plugin
See gh-41228
1 parent 6564abb commit 7e4d60e

File tree

51 files changed

+15
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+15
-15
lines changed

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id "java"
33
id "org.springframework.boot.conventions"
4-
id "org.springframework.boot.integration-test"
4+
id "org.springframework.boot.docker-test"
55
id "de.undercouch.download"
66
}
77

@@ -19,15 +19,15 @@ dependencies {
1919
app project(path: ":spring-boot-project:spring-boot-parent", configuration: "mavenRepository")
2020
app project(path: ":spring-boot-project:spring-boot-tools:spring-boot-gradle-plugin", configuration: "mavenRepository")
2121

22-
intTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
23-
intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
24-
intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
25-
intTestImplementation("org.testcontainers:testcontainers")
22+
dockerTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
23+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
24+
dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
25+
dockerTestImplementation("org.testcontainers:testcontainers")
2626
}
2727

2828
task syncMavenRepository(type: Sync) {
2929
from configurations.app
30-
into "${buildDir}/int-test-maven-repository"
30+
into "${buildDir}/docker-test-maven-repository"
3131
}
3232

3333
task syncAppSource(type: org.springframework.boot.build.SyncAppSource) {
@@ -59,10 +59,10 @@ task syncJdkDownloads(type: Sync) {
5959
into "${project.buildDir}/downloads/jdk/bellsoft/"
6060
}
6161

62-
processIntTestResources {
62+
tasks.named("processDockerTestResources").configure {
6363
dependsOn syncJdkDownloads
6464
}
6565

66-
intTest {
66+
tasks.named("dockerTest").configure {
6767
dependsOn buildApp
6868
}

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
apply plugin: "io.spring.dependency-management"
77

88
repositories {
9-
maven { url "file:${rootDir}/../int-test-maven-repository"}
9+
maven { url "file:${rootDir}/../docker-test-maven-repository"}
1010
mavenCentral()
1111
maven { url "https://repo.spring.io/milestone" }
1212
maven { url "https://repo.spring.io/snapshot" }

spring-boot-tests/spring-boot-integration-tests/spring-boot-launch-script-tests/spring-boot-launch-script-tests-app/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginManagement {
22
repositories {
3-
maven { url "file:${rootDir}/../int-test-maven-repository"}
3+
maven { url "file:${rootDir}/../docker-test-maven-repository"}
44
mavenCentral()
55
maven { url "https://repo.spring.io/snapshot" }
66
maven { url "https://repo.spring.io/milestone" }
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ protected AbstractLaunchScriptIntegrationTests(String scriptsDir) {
5757

5858
static List<Object[]> filterParameters(Predicate<File> osFilter) {
5959
List<Object[]> parameters = new ArrayList<>();
60-
for (File os : new File("src/intTest/resources/conf").listFiles()) {
60+
for (File os : new File("src/dockerTest/resources/conf").listFiles()) {
6161
if (osFilter.test(os)) {
6262
for (File version : os.listFiles()) {
6363
parameters.add(new Object[] { os.getName(), version.getName() });
@@ -103,10 +103,10 @@ private LaunchScriptTestContainer(String os, String version, String scriptsDir,
103103
super(createImage(os, version));
104104
withCopyFileToContainer(MountableFile.forHostPath(findApplication().getAbsolutePath()), "/app.jar");
105105
withCopyFileToContainer(
106-
MountableFile.forHostPath("src/intTest/resources/scripts/" + scriptsDir + "test-functions.sh"),
106+
MountableFile.forHostPath("src/dockerTest/resources/scripts/" + scriptsDir + "test-functions.sh"),
107107
"/test-functions.sh");
108108
withCopyFileToContainer(
109-
MountableFile.forHostPath("src/intTest/resources/scripts/" + scriptsDir + testScript),
109+
MountableFile.forHostPath("src/dockerTest/resources/scripts/" + scriptsDir + testScript),
110110
"/" + testScript);
111111
withCommand("/bin/bash", "-c",
112112
"chown root:root *.sh && chown root:root *.jar && chmod +x " + testScript + " && ./" + testScript);
@@ -117,7 +117,7 @@ private static ImageFromDockerfile createImage(String os, String version) {
117117
ImageFromDockerfile image = new ImageFromDockerfile(
118118
"spring-boot-launch-script/" + os.toLowerCase() + "-" + version);
119119
image.withFileFromFile("Dockerfile",
120-
new File("src/intTest/resources/conf/" + os + "/" + version + "/Dockerfile"));
120+
new File("src/dockerTest/resources/conf/" + os + "/" + version + "/Dockerfile"));
121121
for (File file : new File("build/downloads/jdk/bellsoft").listFiles()) {
122122
image.withFileFromFile("downloads/" + file.getName(), file);
123123
}

0 commit comments

Comments
 (0)