Move deployment tests to system tests pipeline

Closes gh-27499
This commit is contained in:
Scott Frederick 2021-07-12 17:56:09 -05:00
parent 1c6bc9936d
commit 32bb6f6989
13 changed files with 68 additions and 60 deletions

View File

@ -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.*/) {

View File

@ -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 = ''
}

View File

@ -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;

View File

@ -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() {

View File

@ -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() {

View File

@ -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

View File

@ -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

View File

@ -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 = ''
}