diff --git a/apps/quarkus-full-microprofile/quarkus_3.6.x.patch b/apps/quarkus-full-microprofile/quarkus_3.6.x.patch new file mode 100644 index 00000000..3c3013fc --- /dev/null +++ b/apps/quarkus-full-microprofile/quarkus_3.6.x.patch @@ -0,0 +1,247 @@ +diff --git a/apps/quarkus-full-microprofile/pom.xml b/apps/quarkus-full-microprofile/pom.xml +index ce7df81..c047cd9 100644 +--- a/apps/quarkus-full-microprofile/pom.xml ++++ b/apps/quarkus-full-microprofile/pom.xml +@@ -61,7 +61,7 @@ + + + io.quarkus +- quarkus-smallrye-opentracing ++ quarkus-opentelemetry + + + io.quarkus +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/HelloController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/HelloController.java +index 0694ce6..88d552c 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/HelloController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/HelloController.java +@@ -1,8 +1,8 @@ + package com.example.quarkus; + +-import javax.inject.Singleton; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; ++import jakarta.inject.Singleton; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; + + @Path("/hello") + @Singleton +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/QuarkusRestApplication.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/QuarkusRestApplication.java +index 068ba12..410a130 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/QuarkusRestApplication.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/QuarkusRestApplication.java +@@ -1,7 +1,7 @@ + package com.example.quarkus; + +-import javax.ws.rs.ApplicationPath; +-import javax.ws.rs.core.Application; ++import jakarta.ws.rs.ApplicationPath; ++import jakarta.ws.rs.core.Application; + + @ApplicationPath("/data") + public class QuarkusRestApplication extends Application { +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ClientController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ClientController.java +index 0f593eb..7360fcc 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ClientController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ClientController.java +@@ -2,11 +2,11 @@ package com.example.quarkus.client; + + import org.eclipse.microprofile.rest.client.inject.RestClient; + +-import javax.enterprise.context.ApplicationScoped; +-import javax.inject.Inject; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.PathParam; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.PathParam; + + @Path("/client") + @ApplicationScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/Service.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/Service.java +index ac9a4a5..35bcb99 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/Service.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/Service.java +@@ -2,10 +2,10 @@ package com.example.quarkus.client; + + import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; + +-import javax.enterprise.context.ApplicationScoped; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.PathParam; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.PathParam; + + @RegisterRestClient + @ApplicationScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ServiceController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ServiceController.java +index 24a228d..6ec43f9 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ServiceController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/client/ServiceController.java +@@ -1,8 +1,8 @@ + package com.example.quarkus.client; + +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.PathParam; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.PathParam; + + @Path("/client/service") + public class ServiceController { +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/config/ConfigTestController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/config/ConfigTestController.java +index 8119c23..517fe6f 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/config/ConfigTestController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/config/ConfigTestController.java +@@ -4,10 +4,10 @@ import org.eclipse.microprofile.config.Config; + import org.eclipse.microprofile.config.ConfigProvider; + import org.eclipse.microprofile.config.inject.ConfigProperty; + +-import javax.enterprise.context.RequestScoped; +-import javax.inject.Inject; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; ++import jakarta.enterprise.context.RequestScoped; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; + + /** + * !!! DO NOT TOUCH THE SOURCE WITHOUT EDITING GDBSession.java !!! +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceLiveHealthCheck.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceLiveHealthCheck.java +index fea754c..d1ad0a6 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceLiveHealthCheck.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceLiveHealthCheck.java +@@ -4,7 +4,7 @@ import org.eclipse.microprofile.health.HealthCheck; + import org.eclipse.microprofile.health.HealthCheckResponse; + import org.eclipse.microprofile.health.Liveness; + +-import javax.enterprise.context.ApplicationScoped; ++import jakarta.enterprise.context.ApplicationScoped; + + @Liveness + @ApplicationScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceReadyHealthCheck.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceReadyHealthCheck.java +index 6bb6374..cd7ac7a 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceReadyHealthCheck.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/health/ServiceReadyHealthCheck.java +@@ -4,7 +4,7 @@ import org.eclipse.microprofile.health.HealthCheck; + import org.eclipse.microprofile.health.HealthCheckResponse; + import org.eclipse.microprofile.health.Readiness; + +-import javax.enterprise.context.ApplicationScoped; ++import jakarta.enterprise.context.ApplicationScoped; + + @Readiness + @ApplicationScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/metric/MetricController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/metric/MetricController.java +index 1f4c2df..db4c9fa 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/metric/MetricController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/metric/MetricController.java +@@ -6,10 +6,10 @@ import org.eclipse.microprofile.metrics.annotation.Gauge; + import org.eclipse.microprofile.metrics.annotation.Metric; + import org.eclipse.microprofile.metrics.annotation.Timed; + +-import javax.enterprise.context.ApplicationScoped; +-import javax.inject.Inject; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; + import java.util.Random; + + @Path("/metric") +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/resilient/ResilienceController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/resilient/ResilienceController.java +index 04cf5fb..fc34f8e 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/resilient/ResilienceController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/resilient/ResilienceController.java +@@ -3,9 +3,9 @@ package com.example.quarkus.resilient; + import org.eclipse.microprofile.faulttolerance.Fallback; + import org.eclipse.microprofile.faulttolerance.Timeout; + +-import javax.enterprise.context.ApplicationScoped; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; + + @Path("/resilience") + @ApplicationScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/ProtectedController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/ProtectedController.java +index 4447db7..1d54637 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/ProtectedController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/ProtectedController.java +@@ -3,11 +3,11 @@ package com.example.quarkus.secure; + import org.eclipse.microprofile.jwt.Claim; + import org.eclipse.microprofile.jwt.ClaimValue; + +-import javax.annotation.security.RolesAllowed; +-import javax.enterprise.context.RequestScoped; +-import javax.inject.Inject; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; ++import jakarta.annotation.security.RolesAllowed; ++import jakarta.enterprise.context.RequestScoped; ++import jakarta.inject.Inject; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; + + @Path("/protected") + @RequestScoped +diff --git a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/TestSecureController.java b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/TestSecureController.java +index fb82305..a95c3f0 100644 +--- a/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/TestSecureController.java ++++ b/apps/quarkus-full-microprofile/src/main/java/com/example/quarkus/secure/TestSecureController.java +@@ -5,14 +5,14 @@ import io.vertx.ext.auth.PubSecKeyOptions; + import io.vertx.ext.auth.jwt.JWTAuth; + import io.vertx.ext.auth.jwt.JWTAuthOptions; + +-import javax.annotation.PostConstruct; +-import javax.enterprise.context.ApplicationScoped; +-import javax.ws.rs.GET; +-import javax.ws.rs.Path; +-import javax.ws.rs.WebApplicationException; +-import javax.ws.rs.client.ClientBuilder; +-import javax.ws.rs.client.WebTarget; +-import javax.ws.rs.core.Response; ++import jakarta.annotation.PostConstruct; ++import jakarta.enterprise.context.ApplicationScoped; ++import jakarta.ws.rs.GET; ++import jakarta.ws.rs.Path; ++import jakarta.ws.rs.WebApplicationException; ++import jakarta.ws.rs.client.ClientBuilder; ++import jakarta.ws.rs.client.WebTarget; ++import jakarta.ws.rs.core.Response; + import java.io.BufferedReader; + import java.io.IOException; + import java.io.InputStreamReader; +diff --git a/apps/quarkus-full-microprofile/src/main/resources/application.properties b/apps/quarkus-full-microprofile/src/main/resources/application.properties +index 30c3d85..aacd280 100644 +--- a/apps/quarkus-full-microprofile/src/main/resources/application.properties ++++ b/apps/quarkus-full-microprofile/src/main/resources/application.properties +@@ -5,8 +5,10 @@ quarkus.ssl.native=true + mp.jwt.verify.publickey.location=META-INF/resources/publicKey.pem + mp.jwt.verify.issuer=https://server.example.com + quarkus.smallrye-jwt.enabled=true +-quarkus.jaeger.service-name=Demo-Service-A +-quarkus.jaeger.sampler-type=const +-quarkus.jaeger.sampler-param=1 +-quarkus.jaeger.endpoint=http://localhost:14268/api/traces ++quarkus.otel.traces.exporter=cdi ++quarkus.otel.traces.sampler=parentbased_always_on ++quarkus.otel.traces.eusp.enabled=true ++quarkus.otel.service.name=Demo-Service-A ++quarkus.otel.exporter.otlp.endpoint=http://localhost:4317 ++quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:4317 + quarkus.native.resources.includes=privateKey.pem diff --git a/apps/quarkus-full-microprofile/threshold.properties b/apps/quarkus-full-microprofile/threshold.properties index 40741db3..ae56ccba 100644 --- a/apps/quarkus-full-microprofile/threshold.properties +++ b/apps/quarkus-full-microprofile/threshold.properties @@ -1,6 +1,6 @@ linux.time.to.first.ok.request.threshold.ms=300 linux.RSS.threshold.kB=120000 -linux.executable.size.threshold.kB=73500 +linux.executable.size.threshold.kB=79000 windows.time.to.first.ok.request.threshold.ms=1537 windows.RSS.threshold.kB=120000 -windows.executable.size.threshold.kB=75000 +windows.executable.size.threshold.kB=79000 diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java index 8f70a55b..3aabe55e 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/DebugSymbolsTest.java @@ -25,7 +25,6 @@ import org.graalvm.tests.integration.utils.GDBSession; import org.graalvm.tests.integration.utils.Logs; import org.graalvm.tests.integration.utils.WebpageTester; -import org.graalvm.tests.integration.utils.versions.IfQuarkusVersion; import org.graalvm.tests.integration.utils.versions.QuarkusVersion; import org.graalvm.tests.integration.utils.versions.UsedVersion; import org.jboss.logging.Logger; @@ -207,7 +206,6 @@ public void debugSymbolsSmokeGDB(TestInfo testInfo) throws IOException, Interrup @Test @Tag("debugSymbolsQuarkus") @DisabledOnOs({OS.WINDOWS}) - @IfQuarkusVersion(max = "3.5.999") public void debugSymbolsQuarkus(TestInfo testInfo) throws IOException, InterruptedException { final Apps app = Apps.DEBUG_QUARKUS_FULL_MICROPROFILE; LOGGER.info("Testing app: " + app); @@ -216,15 +214,22 @@ public void debugSymbolsQuarkus(TestInfo testInfo) throws IOException, Interrupt final File appDir = Path.of(BASE_DIR, app.dir).toFile(); final String cn = testInfo.getTestClass().get().getCanonicalName(); final String mn = testInfo.getTestMethod().get().getName(); + final String patch; + if (QUARKUS_VERSION.compareTo(new QuarkusVersion("3.6.0")) >= 0 || QUARKUS_VERSION.isSnapshot()) { + patch = "quarkus_3.6.x.patch"; + } else if (QUARKUS_VERSION.majorIs(3)) { + patch = "quarkus_3.x.patch"; + } else { + patch = null; + } try { // Cleanup cleanTarget(app); Files.createDirectories(Paths.get(appDir.getAbsolutePath() + File.separator + "logs")); // Patch for compatibility - if (QUARKUS_VERSION.majorIs(3) || QUARKUS_VERSION.isSnapshot()) { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), - Path.of(BASE_DIR, app.dir).toFile()); + if (patch != null) { + runCommand(getRunCommand("git", "apply", patch), appDir); } // Build @@ -294,9 +299,8 @@ public void debugSymbolsQuarkus(TestInfo testInfo) throws IOException, Interrupt Logs.checkLog(cn, mn, app, processLog); } finally { cleanup(null, cn, mn, report, app, processLog); - if (QUARKUS_VERSION.majorIs(3) || QUARKUS_VERSION.isSnapshot()) { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), - Path.of(BASE_DIR, app.dir).toFile()); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } } diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java index ce9cbb68..b585496c 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/PerfCheckTest.java @@ -27,7 +27,7 @@ import org.graalvm.tests.integration.utils.Uploader; import org.graalvm.tests.integration.utils.WebpageTester; import org.graalvm.tests.integration.utils.versions.IfMandrelVersion; -import org.graalvm.tests.integration.utils.versions.IfQuarkusVersion; +import org.graalvm.tests.integration.utils.versions.QuarkusVersion; import org.graalvm.tests.integration.utils.versions.UsedVersion; import org.jboss.logging.Logger; import org.jboss.resteasy.spi.HttpResponseCodes; @@ -398,7 +398,6 @@ public void testQuarkusJSON(TestInfo testInfo) throws IOException, InterruptedEx @Test @IfMandrelVersion(min = "21.3") - @IfQuarkusVersion(max = "3.5.999") public void testQuarkusFullMicroProfile(TestInfo testInfo) throws IOException, InterruptedException, URISyntaxException { final Apps app = Apps.QUARKUS_FULL_MICROPROFILE_PERF; LOGGER.info("Testing app: " + app); @@ -408,22 +407,32 @@ public void testQuarkusFullMicroProfile(TestInfo testInfo) throws IOException, I final String cn = testInfo.getTestClass().get().getCanonicalName(); final String mn = testInfo.getTestMethod().get().getName(); final List> reports = new ArrayList<>(2); + final String patch; + if (QUARKUS_VERSION.compareTo(new QuarkusVersion("3.6.0")) >= 0 || QUARKUS_VERSION.isSnapshot()) { + patch = "quarkus_3.6.x.patch"; + } else if (QUARKUS_VERSION.majorIs(3)) { + patch = "quarkus_3.x.patch"; + } else { + patch = null; + } try { // Cleanup cleanTarget(app); Files.createDirectories(Paths.get(appDir.getAbsolutePath(), "logs")); assertTrue(app.buildAndRunCmds.cmds.length > 1); - if (QUARKUS_VERSION.majorIs(3) || QUARKUS_VERSION.isSnapshot()) { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), appDir); + if (patch != null) { + runCommand(getRunCommand("git", "apply", patch), appDir); } // Build executables final Map switches = new HashMap<>(); if (UsedVersion.getVersion(false).compareTo(Version.create(22, 2, 0)) >= 0) { - switches.put(GRAALVM_BUILD_OUTPUT_JSON_FILE, "," + GRAALVM_BUILD_OUTPUT_JSON_FILE_SWITCH + "quarkus-json.json"); if (UsedVersion.getVersion(false).compareTo(Version.create(23, 1, 0)) >= 0) { + switches.put(GRAALVM_BUILD_OUTPUT_JSON_FILE, ",-H:+UnlockExperimentalVMOptions," + GRAALVM_BUILD_OUTPUT_JSON_FILE_SWITCH + "quarkus-json.json,-H:-UnlockExperimentalVMOptions"); switches.put("-H:Log=registerResource:", "-H:+UnlockExperimentalVMOptions,-H:Log=registerResource:,-H:-UnlockExperimentalVMOptions"); + } else { + switches.put(GRAALVM_BUILD_OUTPUT_JSON_FILE, "," + GRAALVM_BUILD_OUTPUT_JSON_FILE_SWITCH + "quarkus-json.json"); } } else { switches.put(GRAALVM_BUILD_OUTPUT_JSON_FILE, ""); @@ -515,8 +524,8 @@ public void testQuarkusFullMicroProfile(TestInfo testInfo) throws IOException, I "target", "quarkus-native-image-source-jar", "quarkus-json.json").toFile()); Logs.archiveLog(cn, mn, processLog); cleanTarget(app); - if (QUARKUS_VERSION.majorIs(3) || QUARKUS_VERSION.isSnapshot()) { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), appDir); + if (patch != null) { + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } } diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/RuntimesSmokeTest.java b/testsuite/src/it/java/org/graalvm/tests/integration/RuntimesSmokeTest.java index 47984ffd..da08b33a 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/RuntimesSmokeTest.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/RuntimesSmokeTest.java @@ -25,7 +25,7 @@ import org.graalvm.tests.integration.utils.LogBuilder; import org.graalvm.tests.integration.utils.Logs; import org.graalvm.tests.integration.utils.WebpageTester; -import org.graalvm.tests.integration.utils.versions.IfQuarkusVersion; +import org.graalvm.tests.integration.utils.versions.QuarkusVersion; import org.graalvm.tests.integration.utils.versions.UsedVersion; import org.jboss.logging.Logger; import org.junit.jupiter.api.Assertions; @@ -178,7 +178,6 @@ public void testRuntime(TestInfo testInfo, Apps app, Map switchR @Test @Tag("quarkus") - @IfQuarkusVersion(max = "3.5.999") public void quarkusFullMicroProfile(TestInfo testInfo) throws IOException, InterruptedException { Apps app = Apps.QUARKUS_FULL_MICROPROFILE; final Map switches; @@ -187,14 +186,22 @@ public void quarkusFullMicroProfile(TestInfo testInfo) throws IOException, Inter } else { switches = null; } - if (QUARKUS_VERSION.majorIs(3) || QUARKUS_VERSION.isSnapshot()) { + + final String patch; + if (QUARKUS_VERSION.compareTo(new QuarkusVersion("3.6.0")) >= 0 || QUARKUS_VERSION.isSnapshot()) { + patch = "quarkus_3.6.x.patch"; + } else if (QUARKUS_VERSION.majorIs(3)) { + patch = "quarkus_3.x.patch"; + } else { + patch = null; + } + final File appDir = Path.of(BASE_DIR, app.dir).toFile(); + if (patch != null) { try { - runCommand(getRunCommand("git", "apply", "quarkus_3.x.patch"), - Path.of(BASE_DIR, app.dir).toFile()); + runCommand(getRunCommand("git", "apply", patch), appDir); testRuntime(testInfo, app, switches); } finally { - runCommand(getRunCommand("git", "apply", "-R", "quarkus_3.x.patch"), - Path.of(BASE_DIR, app.dir).toFile()); + runCommand(getRunCommand("git", "apply", "-R", patch), appDir); } } else { testRuntime(testInfo, app, switches); diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java index 3c9993d8..2b51393e 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Commands.java @@ -59,6 +59,7 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.nio.charset.StandardCharsets.UTF_8; @@ -1106,27 +1107,31 @@ public static void builderRoutine(int steps, Apps app, StringBuilder report, Str builderRoutine(steps, app, report, cn, mn, appDir, processLog, null, null); } - public static List replaceSwitchesInCmd(List cmd, Map switchReplacements) { - final List l = new ArrayList<>(cmd.size()); + public static List replaceSwitchesInCmd(final List cmd, final Map switchReplacements) { + final List newCmd = new ArrayList<>(cmd.size()); cmd.forEach(c -> { - final String k = c.trim(); - if (switchReplacements.containsKey(k)) { - final String replacement = switchReplacements.get(k); + String segment = c.trim(); + if (switchReplacements.containsKey(segment)) { + final String replacement = switchReplacements.get(segment); if (!replacement.isEmpty()) { - l.add(replacement); + newCmd.add(replacement); } } else { // Some switches could be nested in e.g. -Dquarkus.native.additional-build-args=, - // thus not found by simple cmd lookup above. - final String key = switchReplacements.keySet().stream().filter(k::contains).findFirst().orElse(null); - if (key != null) { - l.add(k.replace(key, switchReplacements.get(key))); + // thus not found by simple cmd lookup above. There could be more keys to replace too, + // so we need to iterate until all substitutions in a segment are done. Yes. I am beginning to wonder too. + final List keys = switchReplacements.keySet().stream().filter(segment::contains).collect(Collectors.toList()); + if (!keys.isEmpty()) { + for (String key : keys) { + segment = segment.replace(key, switchReplacements.get(key)); + } + newCmd.add(segment); } else { - l.add(c); + newCmd.add(c); } } }); - return l; + return newCmd; } // Copied from diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Logs.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Logs.java index c7194ca9..fdcdc628 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/Logs.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/Logs.java @@ -115,7 +115,7 @@ public static void checkThreshold(Apps app, Mode mode, long executableSizeKb, lo long executableSizeThresholdKb = app.thresholdProperties.get(key); assertThreshold(failures, executableSizeKb <= executableSizeThresholdKb, "Application " + app + (mode != null ? " in mode " + mode : "") + " executable size " + - ((mode == Mode.DIFF_JVM || mode == Mode.DIFF_NATIVE) ? "overhead is" : " is ") + + ((mode == Mode.DIFF_JVM || mode == Mode.DIFF_NATIVE) ? "overhead is" : "is ") + executableSizeKb + " kB, which is over " + executableSizeThresholdKb + " kB threshold by " + percentageValOverTh(executableSizeKb, executableSizeThresholdKb) + "%.", false); } else { diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java index 0bfbfc2d..265828a2 100755 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/WhitelistLogLines.java @@ -41,6 +41,7 @@ public Pattern[] get(boolean inContainer) { Pattern.compile(".*maven-error-diagnostics.*"), // Download https://repo.maven.apache.org/maven2/com/google/errorprone Pattern.compile(".*com/google/errorprone/error_prone.*"), + Pattern.compile(".*com.google.errorprone:error_prone_annotations:jar:sources.*"), // JDK: Pattern.compile("WARNING.* reflective access.*"), Pattern.compile("WARNING: All illegal access operations.*"), @@ -118,7 +119,9 @@ public Pattern[] get(boolean inContainer) { Pattern.compile(".*Warning: Could not register io.netty.* queryAllPublicMethods for reflection.*"), // netty 4 which doesn't have the relevant native config in the lib. See https://github.com/netty/netty/pull/13596 Pattern.compile(".*Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io\\.netty/netty-transport/reflection-config\\.json' is experimental and must be enabled via.*"), - Pattern.compile(".*Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it\\..*") + Pattern.compile(".*Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it\\..*"), + // We don't run any OpenTracing collector point for simplicity, hence the exception. Q 3.6.0+ specific. + Pattern.compile(".*Failed to export spans. The request could not be executed. Full error message: Connection refused:.*") }; } },