From 32bb6f698992a65454f1bdc7e801e59d42fd73b3 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Mon, 12 Jul 2021 17:56:09 -0500 Subject: [PATCH] Move deployment tests to system tests pipeline Closes gh-27499 --- settings.gradle | 2 +- .../spring-boot-deployment-tests/build.gradle | 43 +++++++++++++++++++ .../sample/app/DeploymentTestApplication.java | 0 .../java/sample/app/SampleController.java | 0 .../autoconfig/ExampleAutoConfiguration.java | 0 .../main/resources/META-INF/spring.factories | 0 .../src/main/resources/application.yml | 0 .../deployment/AbstractDeploymentTests.java | 6 +-- ...OpenLibertyDeploymentIntegrationTests.java | 9 ++-- .../TomEEDeploymentIntegrationTests.java | 11 ++--- .../TomcatDeploymentIntegrationTests.java | 9 ++-- .../WildflyDeploymentIntegrationTests.java | 9 ++-- .../spring-boot-deployment-tests/build.gradle | 39 ----------------- 13 files changed, 68 insertions(+), 60 deletions(-) create mode 100644 spring-boot-system-tests/spring-boot-deployment-tests/build.gradle rename {spring-boot-tests => spring-boot-system-tests}/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java (100%) rename {spring-boot-tests => spring-boot-system-tests}/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java (100%) rename {spring-boot-tests => spring-boot-system-tests}/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java (100%) rename {spring-boot-tests => spring-boot-system-tests}/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories (100%) rename {spring-boot-tests => spring-boot-system-tests}/spring-boot-deployment-tests/src/main/resources/application.yml (100%) rename spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/AbstractDeploymentIntegrationTests.java => spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java (97%) rename {spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample => spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment}/OpenLibertyDeploymentIntegrationTests.java (80%) rename {spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample => spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment}/TomEEDeploymentIntegrationTests.java (81%) rename {spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample => spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment}/TomcatDeploymentIntegrationTests.java (83%) rename {spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample => spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment}/WildflyDeploymentIntegrationTests.java (83%) delete mode 100644 spring-boot-tests/spring-boot-deployment-tests/build.gradle diff --git a/settings.gradle b/settings.gradle index 94d8790fb0d..caebdd24727 100644 --- a/settings.gradle +++ b/settings.gradle @@ -71,11 +71,11 @@ include "spring-boot-project:spring-boot-docs" include "spring-boot-project:spring-boot-properties-migrator" include "spring-boot-project:spring-boot-test" include "spring-boot-project:spring-boot-test-autoconfigure" -include "spring-boot-tests:spring-boot-deployment-tests" include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests" include "spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests" include "spring-boot-tests:spring-boot-integration-tests:spring-boot-loader-tests" include "spring-boot-tests:spring-boot-integration-tests:spring-boot-server-tests" +include "spring-boot-system-tests:spring-boot-deployment-tests" include "spring-boot-system-tests:spring-boot-image-tests" file("${rootDir}/spring-boot-project/spring-boot-starters").eachDirMatch(~/spring-boot-starter.*/) { diff --git a/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle b/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle new file mode 100644 index 00000000000..2b211c7b8e0 --- /dev/null +++ b/spring-boot-system-tests/spring-boot-deployment-tests/build.gradle @@ -0,0 +1,43 @@ +plugins { + id "war" + id "org.springframework.boot.conventions" + id "org.springframework.boot.system-test" +} + +description = "Spring Boot Deployment Tests" + +configurations { + providedRuntime { + extendsFrom dependencyManagement + } +} + +configurations.all { + exclude module: "spring-boot-starter-logging" +} + +dependencies { + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) { + exclude group: "org.hibernate.validator" + } + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) + + systemTestImplementation(enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent"))) + systemTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) + systemTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + systemTestImplementation("org.apache.httpcomponents:httpasyncclient") + systemTestImplementation("org.awaitility:awaitility") + systemTestImplementation("org.testcontainers:junit-jupiter") + systemTestImplementation("org.testcontainers:testcontainers") + systemTestImplementation("org.springframework:spring-web") + + providedRuntime(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat")) +} + +systemTest { + inputs.files(war).withNormalizer(ClasspathNormalizer) +} + +war { + archiveVersion = '' +} \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/app/DeploymentTestApplication.java diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/app/SampleController.java diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/main/java/sample/autoconfig/ExampleAutoConfiguration.java diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories b/spring-boot-system-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories rename to spring-boot-system-tests/spring-boot-deployment-tests/src/main/resources/META-INF/spring.factories diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/main/resources/application.yml b/spring-boot-system-tests/spring-boot-deployment-tests/src/main/resources/application.yml similarity index 100% rename from spring-boot-tests/spring-boot-deployment-tests/src/main/resources/application.yml rename to spring-boot-system-tests/spring-boot-deployment-tests/src/main/resources/application.yml diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/AbstractDeploymentIntegrationTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java similarity index 97% rename from spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/AbstractDeploymentIntegrationTests.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java index d731fdd8056..fa79709ba57 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/AbstractDeploymentIntegrationTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/AbstractDeploymentTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.deployment; import java.io.File; import java.time.Duration; @@ -37,9 +37,9 @@ import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import static org.assertj.core.api.Assertions.assertThat; /** - * Abstract class for deployment integration tests. + * Abstract class for deployment tests. */ -abstract class AbstractDeploymentIntegrationTests { +abstract class AbstractDeploymentTests { protected static final int DEFAULT_PORT = 8080; diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/OpenLibertyDeploymentIntegrationTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/OpenLibertyDeploymentIntegrationTests.java similarity index 80% rename from spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/OpenLibertyDeploymentIntegrationTests.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/OpenLibertyDeploymentIntegrationTests.java index 33392360744..e412eda826d 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/OpenLibertyDeploymentIntegrationTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/OpenLibertyDeploymentIntegrationTests.java @@ -14,24 +14,25 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.deployment; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; /** - * Deployment integration tests for Open Liberty. + * Deployment tests for Open Liberty. * * @author Christoph Dreis + * @author Scott Frederick */ @Testcontainers(disabledWithoutDocker = true) -class OpenLibertyDeploymentIntegrationTests extends AbstractDeploymentIntegrationTests { +class OpenLibertyDeploymentTests extends AbstractDeploymentTests { private static final int PORT = 9080; @Container static WarDeploymentContainer container = new WarDeploymentContainer( - "openliberty/open-liberty:20.0.0.9-kernel-java8-openj9-ubi", "/config/dropins", PORT); + "openliberty/open-liberty:full-java8-openj9-ubi", "/config/dropins", PORT); @Override WarDeploymentContainer getContainer() { diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomEEDeploymentIntegrationTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomEEDeploymentIntegrationTests.java similarity index 81% rename from spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomEEDeploymentIntegrationTests.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomEEDeploymentIntegrationTests.java index a04caff1aae..165debfa436 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomEEDeploymentIntegrationTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomEEDeploymentIntegrationTests.java @@ -14,22 +14,23 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.deployment; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; /** - * Deployment integration tests for TomEE. + * Deployment tests for TomEE. * * @author Christoph Dreis + * @author Scott Frederick */ @Testcontainers(disabledWithoutDocker = true) -class TomEEDeploymentIntegrationTests extends AbstractDeploymentIntegrationTests { +class TomEEDeploymentTests extends AbstractDeploymentTests { @Container - static WarDeploymentContainer container = new WarDeploymentContainer("tomee:8-jre-8.0.2-webprofile", - "/usr/local/tomee/webapps", DEFAULT_PORT); + static WarDeploymentContainer container = new WarDeploymentContainer("tomee:8", "/usr/local/tomee/webapps", + DEFAULT_PORT); @Override WarDeploymentContainer getContainer() { diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomcatDeploymentIntegrationTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentIntegrationTests.java similarity index 83% rename from spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomcatDeploymentIntegrationTests.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentIntegrationTests.java index 4585b4bd46b..d959ba578ef 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/TomcatDeploymentIntegrationTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/TomcatDeploymentIntegrationTests.java @@ -14,21 +14,22 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.deployment; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; /** - * Deployment integration tests for Tomcat. + * Deployment tests for Tomcat. * * @author Christoph Dreis + * @author Scott Frederick */ @Testcontainers(disabledWithoutDocker = true) -class TomcatDeploymentIntegrationTests extends AbstractDeploymentIntegrationTests { +class TomcatDeploymentTests extends AbstractDeploymentTests { @Container - static WarDeploymentContainer container = new WarDeploymentContainer("tomcat:9.0.37-jdk8-openjdk", + static WarDeploymentContainer container = new WarDeploymentContainer("tomcat:9-jdk8-openjdk", "/usr/local/tomcat/webapps", DEFAULT_PORT); @Override diff --git a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/WildflyDeploymentIntegrationTests.java b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/WildflyDeploymentIntegrationTests.java similarity index 83% rename from spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/WildflyDeploymentIntegrationTests.java rename to spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/WildflyDeploymentIntegrationTests.java index cf60688af55..1ccf0170ef4 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/src/intTest/java/sample/WildflyDeploymentIntegrationTests.java +++ b/spring-boot-system-tests/spring-boot-deployment-tests/src/systemTest/java/org/springframework/boot/deployment/WildflyDeploymentIntegrationTests.java @@ -14,21 +14,22 @@ * limitations under the License. */ -package sample; +package org.springframework.boot.deployment; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; /** - * Deployment integration tests for Wildfly. + * Deployment tests for Wildfly. * * @author Christoph Dreis + * @author Scott Frederick */ @Testcontainers(disabledWithoutDocker = true) -class WildflyDeploymentIntegrationTests extends AbstractDeploymentIntegrationTests { +class WildflyDeploymentTests extends AbstractDeploymentTests { @Container - static WarDeploymentContainer container = new WarDeploymentContainer("jboss/wildfly:20.0.1.Final", + static WarDeploymentContainer container = new WarDeploymentContainer("jboss/wildfly:latest", "/opt/jboss/wildfly/standalone/deployments", DEFAULT_PORT); @Override diff --git a/spring-boot-tests/spring-boot-deployment-tests/build.gradle b/spring-boot-tests/spring-boot-deployment-tests/build.gradle deleted file mode 100644 index 150b8dc29e9..00000000000 --- a/spring-boot-tests/spring-boot-deployment-tests/build.gradle +++ /dev/null @@ -1,39 +0,0 @@ -plugins { - id "war" - id "org.springframework.boot.conventions" - id "org.springframework.boot.integration-test" -} - -description = "Spring Boot Deployment Tests" - -configurations { - providedRuntime { - extendsFrom dependencyManagement - } -} - -dependencies { - implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) { - exclude group: "org.hibernate.validator" - } - implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) - - intTestImplementation(enforcedPlatform(project(path: ":spring-boot-project:spring-boot-parent"))) - intTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) - intTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - intTestImplementation("org.apache.httpcomponents:httpasyncclient") - intTestImplementation("org.awaitility:awaitility") - intTestImplementation("org.testcontainers:junit-jupiter") - intTestImplementation("org.testcontainers:testcontainers") - intTestImplementation("org.springframework:spring-web") - - providedRuntime(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-tomcat")) -} - -intTest { - inputs.files(war).withNormalizer(ClasspathNormalizer) -} - -war { - archiveVersion = '' -} \ No newline at end of file