Skip to content

Commit 1ce86d8

Browse files
authored
Merge pull request #430 from Karm/quarkus-upgrade-and-gradle
Quarkus 1.7.0.Final -> 1.7.6.Final , Gradle support, CI, WildFly versions match MP versions
2 parents 3982219 + 7674374 commit 1ce86d8

33 files changed

+501
-287
lines changed

.github/workflows/main.yml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MicroProfile Starter Tests
1+
name: Tests
22

33
on:
44
push:
@@ -27,50 +27,56 @@ on:
2727

2828
env:
2929
LANG: en_US.UTF-8
30-
JAVA_HOME: ${{ github.workspace }}/openjdk
31-
30+
GRADLE_USER_HOME: ~/.gradle
31+
3232
jobs:
3333
run-starter:
34-
name: MicroProfile Starter build and test - ${{ matrix.jdk }}
35-
runs-on: ubuntu-18.04
34+
name: ${{ matrix.runtime }} MicroProfile Starter
35+
runs-on: ubuntu-20.04
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
jdk: ['OpenJDK11-latest-GA']
40-
include:
41-
- jdk: 'OpenJDK11-latest-GA'
42-
release_type: 'ga'
39+
runtime: [ 'helidon',
40+
'kumuluzee',
41+
'liberty',
42+
'payara',
43+
'quarkus',
44+
'thorntail',
45+
'tomee',
46+
'wildfly' ]
4347
steps:
44-
- uses: actions/checkout@v1
48+
- uses: actions/checkout@v2
4549
with:
4650
fetch-depth: 1
47-
path: starter
48-
- uses: actions/cache@v1
51+
- uses: actions/cache@v2
4952
with:
5053
path: ~/.m2/repository
51-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
54+
key: ${{ runner.os }}-${{ matrix.runtime }}-maven-${{ hashFiles('**/pom.xml') }}
5255
restore-keys: |
53-
${{ runner.os }}-maven-
54-
- name: Get OpenJDK 11
55-
run: |
56-
curl -sL https://api.adoptopenjdk.net/v3/binary/latest/11/${{ matrix.release_type }}/linux/x64/jdk/hotspot/normal/openjdk -o jdk.tar.gz
57-
mkdir -p ${JAVA_HOME}
58-
tar xf jdk.tar.gz -C ${JAVA_HOME} --strip-components=1
59-
echo ${JAVA_HOME}
60-
${JAVA_HOME}/bin/java --version
56+
${{ runner.os }}-${{ matrix.runtime }}-maven-
57+
- uses: actions/cache@v2
58+
with:
59+
path: |
60+
~/.gradle/caches
61+
~/.gradle/wrapper
62+
key: ${{ runner.os }}-${{ matrix.runtime }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
63+
restore-keys: |
64+
${{ runner.os }}-${{ matrix.runtime }}-gradle-
65+
- uses: actions/setup-java@v2
66+
with:
67+
distribution: 'adopt'
68+
java-version: '11'
69+
check-latest: true
6170
- name: Build and run tests for Starter
6271
run: |
63-
cd ${{ github.workspace }}
64-
export PATH=${JAVA_HOME}/bin:${PATH}
65-
mvn clean verify -Pthorntail
72+
mvn clean verify -Pthorntail -Dtest=TestMatrixTest#${{ matrix.runtime }}* -DSTARTER_TS_WORKSPACE=$RUNNER_TEMP
6673
- name: Prepare failure archive (if maven failed)
6774
if: failure()
6875
shell: bash
69-
run: find . -type d -name '*-reports' -o -wholename '*/build/reports/tests/functionalTest' -o -name "*.log" | tar -czf test-reports.tgz -T -
76+
run: find . -type d -name '*-reports' -o -name "*.log" | tar -czf test-reports-${{ matrix.runtime }}.tgz -T -
7077
- name: Upload failure Archive (if maven failed)
7178
uses: actions/upload-artifact@v2
7279
if: failure()
7380
with:
74-
name: test-reports
75-
path: 'test-reports.tgz'
76-
81+
name: test-reports-${{ matrix.runtime }}
82+
path: 'test-reports-${{ matrix.runtime }}.tgz'

pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,6 @@
328328
<scope>test</scope>
329329
</dependency>
330330

331-
<dependency>
332-
<groupId>junit</groupId>
333-
<artifactId>junit</artifactId>
334-
<version>${junit.version}</version>
335-
<scope>test</scope>
336-
</dependency>
337-
338331
</dependencies>
339332

340333
<dependencyManagement>

src/it/java/org/eclipse/microprofile/starter/TestMatrixTest.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@
4848
import static org.eclipse.microprofile.starter.utils.Commands.cleanWorkspace;
4949
import static org.eclipse.microprofile.starter.utils.Commands.download;
5050
import static org.eclipse.microprofile.starter.utils.Commands.getWorkspaceDir;
51+
import static org.eclipse.microprofile.starter.utils.Commands.isThisWindows;
52+
import static org.eclipse.microprofile.starter.utils.Commands.linuxCmdCleaner;
5153
import static org.eclipse.microprofile.starter.utils.Commands.processStopper;
5254
import static org.eclipse.microprofile.starter.utils.Commands.runCommand;
5355
import static org.eclipse.microprofile.starter.utils.Commands.unzip;
56+
import static org.eclipse.microprofile.starter.utils.Commands.windowsCmdCleaner;
5457
import static org.eclipse.microprofile.starter.utils.Logs.archiveLog;
5558
import static org.eclipse.microprofile.starter.utils.Logs.checkLog;
5659
import static org.eclipse.microprofile.starter.utils.ReadmeParser.parseReadme;
@@ -178,6 +181,13 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection
178181
Commands.runCommand(new String[]{"./gradlew", "libertyStop"}, directoryB, runLogB);
179182
}
180183
}
184+
if (buildTool == BuildTool.GRADLE && supportedServer.equalsIgnoreCase("LIBERTY")) {
185+
if (isThisWindows()) {
186+
windowsCmdCleaner("defaultServer");
187+
} else {
188+
linuxCmdCleaner("defaultServer");
189+
}
190+
}
181191

182192
checkLog(this.getClass().getCanonicalName(), testName.getMethodName(), "Runtime log", runLogA);
183193
if (specSelection.hasServiceB) {
@@ -186,11 +196,11 @@ public void testRuntime(String supportedServer, String artifactId, SpecSelection
186196
LOGGER.info("Gonna wait for ports closed...");
187197
// Release ports
188198
assertTrue("Main ports are still open",
189-
Commands.waitForTcpClosed("localhost", Commands.parsePort(urlBase), 60));
199+
Commands.waitForTcpClosed("localhost", Commands.parsePort(urlBase), 90));
190200
if (additionalPortsToCheck != null) {
191201
for (int port : additionalPortsToCheck) {
192202
assertTrue("Ports are still open",
193-
Commands.waitForTcpClosed("localhost", port, 30));
203+
Commands.waitForTcpClosed("localhost", port, 60));
194204
}
195205
}
196206
} finally {
@@ -513,6 +523,13 @@ public void quarkusEmpty() throws IOException, InterruptedException {
513523
SpecSelection.EMPTY, new int[]{9990}, BuildTool.MAVEN);
514524
}
515525

526+
@Test
527+
@RunAsClient
528+
public void quarkusAllGradle() throws IOException, InterruptedException {
529+
testRuntime("QUARKUS", "quarkus",
530+
SpecSelection.ALL, new int[]{9990, 8180, 10090}, BuildTool.GRADLE);
531+
}
532+
516533
@Test
517534
@RunAsClient
518535
public void quarkusAll() throws IOException, InterruptedException {

src/it/java/org/eclipse/microprofile/starter/utils/Commands.java

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
import java.util.Objects;
4343
import java.util.concurrent.TimeUnit;
4444
import java.util.logging.Logger;
45+
import java.util.regex.Matcher;
46+
import java.util.regex.Pattern;
4547

4648
import static org.eclipse.microprofile.starter.TestMatrixTest.API_URL;
4749
import static org.eclipse.microprofile.starter.TestMatrixTest.TMP;
@@ -55,6 +57,8 @@ public class Commands {
5557

5658
private static final String STARTER_TS_WORKSPACE = "STARTER_TS_WORKSPACE";
5759

60+
private static final Pattern LINUX_PS_AUX_PID = Pattern.compile("\\w*\\s*(\\d*).*");
61+
5862
public static String getWorkspaceDir() {
5963
String env = System.getenv().get(STARTER_TS_WORKSPACE);
6064
if (StringUtils.isNotBlank(env)) {
@@ -197,11 +201,11 @@ public static void processStopper(Process p, String artifactId) throws Interrupt
197201
}
198202
}
199203

200-
public static void windowsCmdCleaner(String artifactId) throws IOException, InterruptedException {
204+
public static void windowsCmdCleaner(String appName) throws IOException, InterruptedException {
201205
List<Long> pidsToKill = new ArrayList<>(2);
202206
String[] wmicPIDcmd = new String[]{
203207
"wmic", "process", "where", "(",
204-
"commandline", "like", "\"%\\\\" + artifactId + "\\\\%\"", "and", "name", "=", "\"java.exe\"", "and",
208+
"commandline", "like", "\"%\\\\" + appName + "\\\\%\"", "and", "name", "=", "\"java.exe\"", "and",
205209
"not", "commandline", "like", "\"%wmic%\"", "and",
206210
"not", "commandline", "like", "\"%maven%\"",
207211
")", "get", "Processid", "/format:list"};
@@ -229,6 +233,35 @@ public static void windowsCmdCleaner(String artifactId) throws IOException, Inte
229233
pidsToKill.forEach(Commands::pidKiller);
230234
}
231235

236+
public static void linuxCmdCleaner(String appName) throws IOException, InterruptedException {
237+
List<Long> pidsToKill = new ArrayList<>(2);
238+
ProcessBuilder pbA = new ProcessBuilder("ps", "aux");
239+
pbA.redirectErrorStream(true);
240+
Process p = pbA.start();
241+
try (BufferedReader processOutputReader = new BufferedReader(new InputStreamReader(p.getInputStream()))) {
242+
String l;
243+
while ((l = processOutputReader.readLine()) != null) {
244+
if (l.contains(appName)) {
245+
Matcher m = LINUX_PS_AUX_PID.matcher(l);
246+
if (m.lookingAt()) {
247+
try {
248+
pidsToKill.add(Long.parseLong(m.group(1)));
249+
} catch (NumberFormatException ex) {
250+
//Silence is golden. We don't care about ps output glitches. This is a best effort.
251+
}
252+
}
253+
}
254+
}
255+
p.waitFor();
256+
}
257+
if (pidsToKill.isEmpty()) {
258+
LOGGER.warning("ps didn't find any additional PIDs to kill.");
259+
} else {
260+
LOGGER.info(String.format("ps found %d additional pids to kill", pidsToKill.size()));
261+
}
262+
pidsToKill.forEach(Commands::pidKiller);
263+
}
264+
232265
public static boolean isThisWindows() {
233266
return System.getProperty("os.name").matches(".*[Ww]indows.*");
234267
}

src/it/java/org/eclipse/microprofile/starter/utils/Whitelist.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,20 @@ public enum Whitelist {
5454
}),
5555
TOMEE("tomee", new Pattern[]{}),
5656
QUARKUS("quarkus", new Pattern[]{
57+
Pattern.compile(".*error_prone_annotations.*"),
58+
Pattern.compile(".*error_prone_parent.*"),
5759
Pattern.compile(".*\\[org.jboss.threads.errors] Thread Thread\\[build.*"),
5860
Pattern.compile(".*org/jboss/threads/EnhancedQueueExecutor.*"),
61+
// If there is nobody to receive traces, there is a log about it.
62+
Pattern.compile(".*io.jaegertracing.internal.exceptions.SenderException.*"),
5963
}),
6064
WILDFLY("wildfly", new Pattern[]{
65+
Pattern.compile(".*error_prone_annotations.*"),
66+
Pattern.compile(".*error_prone_parent.*"),
6167
Pattern.compile(".*wildfly-domain-http-error-context.*"),
68+
// Known warning, needs WF update
69+
Pattern.compile(".*io/netty/util/internal/logging/Log4J2Logger.*"),
70+
Pattern.compile(".*io.undertow.servlet.handlers.SendErrorPageHandler.*"),
6271
});
6372

6473
public final String name;

src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/MicroprofileServersAddon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public class MicroprofileServersAddon extends AbstractMicroprofileAddon {
5959
private List<MicroprofileSpec> microprofileSpecs;
6060
private List<StandaloneMPSpec> microprofileStandaloneSpecs;
6161

62-
private static final String VERTX_JWT_VERSION = "3.9.2";
62+
public static final String VERTX_JWT_VERSION = "3.9.5";
6363

6464
@PostConstruct
6565
public void init() {

src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/JDKSelector.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public void init() {
4444
fillJavaSEVersion(data, SupportedServer.THORNTAIL_V2, JavaSEVersion.SE11, MicroProfileVersion.MP22, null); // Supported from MP 2.2
4545

4646
fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE8, null, null); // Supported for all MPVersions
47+
fillJavaSEVersion(data, SupportedServer.QUARKUS, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported from MP 3.2
4748

4849
fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE8, null, null); // Supported for all MPVersions
4950
fillJavaSEVersion(data, SupportedServer.WILDFLY, JavaSEVersion.SE11, MicroProfileVersion.MP32, null); // Supported from MP 3.2

src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/model/SupportedServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public enum SupportedServer {
5454
, "8080" //portServiceA
5555
, "8180" //portServiceB
5656
, "https://quarkus.io/"
57-
, false) // GradleSupport
57+
, true) // GradleSupport
5858
, WILDFLY("wildfly", "WildFly",
5959
Arrays.asList(MicroProfileVersion.MP32, MicroProfileVersion.MP33, MicroProfileVersion.MP40)
60-
, "%s-wildfly.jar" //jarFileName
60+
, "%s-bootable.jar" //jarFileName
6161
, "-Djboss.socket.binding.port-offset=100" //jarParameters
6262
, "8080" //portServiceA
6363
, "8180" //portServiceB

src/main/java/org/eclipse/microprofile/starter/addon/microprofile/servers/server/HelidonServer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@
3333
import javax.enterprise.context.ApplicationScoped;
3434
import javax.inject.Inject;
3535
import java.util.HashMap;
36+
import java.util.HashSet;
3637
import java.util.List;
3738
import java.util.Map;
3839
import java.util.Set;
39-
import java.util.HashSet;
4040

4141
@ApplicationScoped
4242
public class HelidonServer extends AbstractMicroprofileAddon {
@@ -94,7 +94,7 @@ public void createFiles(JessieModel model) {
9494
Set<String> tempAlternative = new HashSet<>(alternatives);
9595
tempAlternative.add(JessieModel.SECONDARY_INDICATOR);
9696
templateEngine.processTemplateFile(viewDirectory,
97-
"RestApplication.java",variables.get("application") + "RestApplication.java", tempAlternative, variables);
97+
"RestApplication.java", variables.get("application") + "RestApplication.java", tempAlternative, variables);
9898

9999
String bResourcesDir = model.getDirectory(false) + "/" + MavenCreator.SRC_MAIN_RESOURCES;
100100
String bResourcesMETAINFDir = bResourcesDir + "/META-INF";

0 commit comments

Comments
 (0)