From 803c6c857ec1a3a0be51763b1cc4289fec3dcb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Sapp=C3=A9=20Griot?= Date: Fri, 20 Oct 2023 14:41:22 +0200 Subject: [PATCH] [WFLY-18460] bmt Quickstart Common Enhancements CY2023Q3 --- .github/workflows/quickstart_bmt_ci .yml | 14 +++ bmt/README.adoc | 11 +- bmt/charts/helm.yaml | 6 + bmt/pom.xml | 115 +++++++++++++++++- .../quickstarts/cmt/BasicRuntimeIT.java | 59 +++++++++ 5 files changed, 197 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/quickstart_bmt_ci .yml create mode 100644 bmt/charts/helm.yaml create mode 100644 bmt/src/test/java/org/wildfly/quickstarts/cmt/BasicRuntimeIT.java diff --git a/.github/workflows/quickstart_bmt_ci .yml b/.github/workflows/quickstart_bmt_ci .yml new file mode 100644 index 0000000000..2502157dd9 --- /dev/null +++ b/.github/workflows/quickstart_bmt_ci .yml @@ -0,0 +1,14 @@ +name: WildFly bmt Quickstart CI + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + paths: + - 'bmt/**' + - '.github/workflows/quickstart_ci.yml' +jobs: + call-quickstart_ci: + uses: ./.github/workflows/quickstart_ci.yml + with: + QUICKSTART_PATH: bmt + TEST_PROVISIONED_SERVER: true diff --git a/bmt/README.adoc b/bmt/README.adoc index 884ed4a8e8..2f00a55db4 100644 --- a/bmt/README.adoc +++ b/bmt/README.adoc @@ -62,13 +62,16 @@ WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in HHH000431: Unable to determine H2 database version, certain features may not work ---- +// Server Distribution Testing +include::../shared-doc/run-integration-tests-with-server-distribution.adoc[leveloffset=+1] // Undeploy the Quickstart include::../shared-doc/undeploy-the-quickstart.adoc[leveloffset=+1] -// Run the Quickstart in Red Hat CodeReady Studio or Eclipse -include::../shared-doc/run-the-quickstart-in-jboss-developer-studio.adoc[leveloffset=+1] -// Debug the Application -include::../shared-doc/debug-the-application.adoc[leveloffset=+1] +// Build and run sections for other environments/builds +ifndef::ProductRelease,EAPXPRelease[] +include::../shared-doc/build-and-run-the-quickstart-with-provisioned-server.adoc[leveloffset=+1] +endif::[] +include::../shared-doc/build-and-run-the-quickstart-with-openshift.adoc[leveloffset=+1] endif::[] //************************************************* diff --git a/bmt/charts/helm.yaml b/bmt/charts/helm.yaml new file mode 100644 index 0000000000..de7dd19e21 --- /dev/null +++ b/bmt/charts/helm.yaml @@ -0,0 +1,6 @@ +build: + uri: https://github.com/wildfly/quickstart.git + ref: main + contextDir: bmt +deploy: + replicas: 1 \ No newline at end of file diff --git a/bmt/pom.xml b/bmt/pom.xml index 1306accb5c..fa6c544211 100644 --- a/bmt/pom.xml +++ b/bmt/pom.xml @@ -44,8 +44,12 @@ - - 30.0.0.Final + + 30.0.0.Final + + ${version.server} + 5.0.0.Final + 4.2.0.Final @@ -109,7 +113,7 @@ org.wildfly.bom wildfly-ee-with-tools - ${version.server.bom} + ${version.bom.ee} pom import @@ -160,6 +164,109 @@ jakarta.transaction-api provided + + + + + junit + junit + test + - + + + + provisioned-server + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + org.wildfly:wildfly-galleon-pack:${version.server} + + + + cloud-server + ejb + jsf + embedded-activemq + h2-default-datasource + + ROOT.war + + + + + package + + + + + + + + + openshift + + + + org.wildfly.plugins + wildfly-maven-plugin + + + + org.wildfly:wildfly-galleon-pack:${version.server} + + + org.wildfly.cloud:wildfly-cloud-galleon-pack:${version.pack.cloud} + + + + cloud-server + ejb + jsf + embedded-activemq + h2-default-datasource + + ROOT.war + + + + + package + + + + + + + + + integration-testing + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + **/BasicRuntimeIT + + + + + + integration-test + verify + + + + + + + + diff --git a/bmt/src/test/java/org/wildfly/quickstarts/cmt/BasicRuntimeIT.java b/bmt/src/test/java/org/wildfly/quickstarts/cmt/BasicRuntimeIT.java new file mode 100644 index 0000000000..f6947bf0ea --- /dev/null +++ b/bmt/src/test/java/org/wildfly/quickstarts/cmt/BasicRuntimeIT.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 JBoss by Red Hat. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.wildfly.quickstarts.cmt; + +import org.junit.Test; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.Duration; + +import static org.junit.Assert.assertEquals; + +/** + * The very basic runtime integration testing. + * @author emartins + */ +public class BasicRuntimeIT { + + private static final String DEFAULT_SERVER_HOST = "http://localhost:8080/bmt"; + + @Test + public void testHTTPEndpointIsAvailable() throws IOException, InterruptedException, URISyntaxException { + String serverHost = System.getenv("SERVER_HOST"); + if (serverHost == null) { + serverHost = System.getProperty("server.host"); + } + if (serverHost == null) { + serverHost = DEFAULT_SERVER_HOST; + } + final HttpRequest request = HttpRequest.newBuilder() + .uri(new URI(serverHost+"/BMT")) + .GET() + .build(); + final HttpClient client = HttpClient.newBuilder() + .followRedirects(HttpClient.Redirect.ALWAYS) + .connectTimeout(Duration.ofMinutes(1)) + .build(); + final HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); + assertEquals(200, response.statusCode()); + } + +} \ No newline at end of file