Skip to content

Commit

Permalink
Changes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario committed Apr 28, 2021
1 parent d0bc598 commit 7133090
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ jobs:
# Increased the page-file size due to memory-consumption of native-image command
# For details see https://github.com/actions/virtual-environments/issues/785
uses: al-cheb/[email protected]
# We do this so we can get better analytics for the downloaded version of the build images
- name: Update Docker Client User Agent
shell: bash
run: |
cat <<< $(jq '.HttpHeaders += {"User-Agent": "Quarkus-CI-Docker-Client"}' ~/.docker/config.json) > ~/.docker/config.json
- name: Build with Maven
run: |
mvn -V -B -s .github/mvn-settings.xml clean verify -DexcludeTags="product,codequarkus" -Dquarkus.native.native-image-xmx=6g
Expand Down
20 changes: 5 additions & 15 deletions testsuite/src/it/java/io/quarkus/ts/startstop/utils/Logs.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static io.quarkus.ts.startstop.StartStopTest.BASE_DIR;
import static io.quarkus.ts.startstop.utils.Commands.isThisWindows;
Expand Down Expand Up @@ -96,21 +97,10 @@ public static void checkLog(String testClass, String testMethod, Apps app, MvnCm
}
}

List<Pattern> ignoredLines = new ArrayList<>(Arrays.asList(WhitelistLogLines.COMMON.errs));
if (Commands.isThisWindows) {
ignoredLines.addAll(Arrays.asList(WhitelistLogLines.WINDOWS_COMMON.errs));

if (isDevModeError(offendingLines)) {
// Quarkus is not being gratefully shutdown in Windows when running in Dev mode.
// Reported by https://github.com/quarkusio/quarkus/issues/14647.
ignoredLines.addAll(Arrays.asList(WhitelistLogLines.WINDOWS_DEV_MODE_ERRORS.errs));
} else if (cmd == MvnCmds.NATIVE || cmd == MvnCmds.MVNW_NATIVE) {
ignoredLines.addAll(Arrays.asList(WhitelistLogLines.WINDOWS_NATIVE.errs));
}
}

for (Pattern ignoredLine : ignoredLines) {
offendingLines.removeIf(line -> ignoredLine.matcher(line).matches());
// Randomly fails when vertx-cache temporary directory exists. Related to https://github.com/quarkusio/quarkus/issues/7678
// And https://github.com/quarkusio/quarkus/pull/15541/files#diff-a38e0d86cf6a637c19b6e0a0e23959f644886bdcc0f0e5615ce7cfa0e6bc9909R244
if (Commands.isThisWindows && isDevModeError(offendingLines)) {
Stream.of(WhitelistLogLines.WINDOWS_DEV_MODE_ERRORS.errs).forEach(lineToIgnore -> offendingLines.removeIf(line -> lineToIgnore.matcher(line).matches()));
}

assertTrue(offendingLines.isEmpty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
* @author Michal Karm Babacek <[email protected]>
*/
public enum WhitelistLogLines {
COMMON(new Pattern[] {
// Randomly fails when vertx-cache temporary directory exists. Related to https://github.com/quarkusio/quarkus/issues/7678
// And https://github.com/quarkusio/quarkus/pull/15541/files#diff-a38e0d86cf6a637c19b6e0a0e23959f644886bdcc0f0e5615ce7cfa0e6bc9909R244
Pattern.compile(".*Unable to make the Vert.x cache directory.*"),
}),
JAX_RS_MINIMAL(new Pattern[]{
// Some artifacts names...
Pattern.compile(".*maven-error-diagnostics.*"),
Expand Down Expand Up @@ -83,25 +78,20 @@ public enum WhitelistLogLines {
// Result of DevServices support https://github.com/quarkusio/quarkus/pull/14960
Pattern.compile(".*Unable to determine a database type for default datasource.*"),
}),
WINDOWS_COMMON(new Pattern[] {
// When running on Windows, some warning SLF4J traces are randomly printed
Pattern.compile(".*SLF4J: .*")
}),
// Quarkus is not being gratefully shutdown in Windows when running in Dev mode.
// Reported by https://github.com/quarkusio/quarkus/issues/14647.
WINDOWS_DEV_MODE_ERRORS(new Pattern[]{
Pattern.compile(".*Re-run Maven using the -X switch to enable full debug logging.*"),
Pattern.compile(".*For more information about the errors and possible solutions, please read the following articles.*"),
Pattern.compile(".*Failed to run: Dev mode process did not complete successfully.*"),
Pattern.compile(".*http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException.*"),
Pattern.compile(".*To see the full stack trace of the errors, re-run Maven with the -e switch.*"),
Pattern.compile("\\[ERROR\\] *"),
}),
WINDOWS_NATIVE(new Pattern[]{
Pattern.compile(".*Uber JAR strategy is used for native image source JAR generation on Windows.*"),
Pattern.compile(".*Duplicate entry about.html entry.*"),
Pattern.compile(".*Dependencies with duplicate files detected.*"),
Pattern.compile(".*objcopy executable not found in PATH. Debug symbols will not be separated from executable.*"),
Pattern.compile(".*That will result in a larger native image with debug symbols embedded in it.*"),
});

// Randomly fails when vertx-cache temporary directory exists. Related to https://github.com/quarkusio/quarkus/issues/7678
// And https://github.com/quarkusio/quarkus/pull/15541/files#diff-a38e0d86cf6a637c19b6e0a0e23959f644886bdcc0f0e5615ce7cfa0e6bc9909R244
private static final Pattern COMMON_ERROR_VERTX_CACHE_DIRECTORY = Pattern.compile(".*Unable to make the Vert.x cache directory.*");

public final Pattern[] errs;

Expand All @@ -113,9 +103,22 @@ public final Pattern[] platformErrs() {
switch (OS.current()) {
case MAC:
return new Pattern[] {
COMMON_ERROR_VERTX_CACHE_DIRECTORY,
Pattern.compile(".*objcopy executable not found in PATH. Debug symbols will not be separated from executable.*"),
Pattern.compile(".*That will result in a larger native image with debug symbols embedded in it.*"),
};
case WINDOWS:
return new Pattern[] {
COMMON_ERROR_VERTX_CACHE_DIRECTORY,
Pattern.compile(".*Uber JAR strategy is used for native image source JAR generation on Windows.*"),
Pattern.compile(".*objcopy executable not found in PATH. Debug symbols will not be separated from executable.*"),
Pattern.compile(".*That will result in a larger native image with debug symbols embedded in it.*"),
};
case LINUX:
return new Pattern[] {
COMMON_ERROR_VERTX_CACHE_DIRECTORY,
};

}
return new Pattern[] {};
}
Expand Down

0 comments on commit 7133090

Please sign in to comment.