From 6e753163050acc391dcfd1b7a52414f2b5832845 Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 10:34:37 +0200 Subject: [PATCH 1/7] Move to Quarkus 999-SNAPSHOT including daily and PR CI --- .github/workflows/ci.yml | 49 ++++++++++++++---------------------- .github/workflows/daily.yaml | 49 ++++++++++++++---------------------- pom.xml | 2 +- 3 files changed, 39 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 054f77af5..158b6cf92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,9 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.java }} check-latest: true - - name: Build Quarkus 2.7 + - name: Build Quarkus main run: | - git clone https://github.com/quarkusio/quarkus.git && cd quarkus && git checkout 2.7 && ./mvnw -B -s .github/mvn-settings.xml clean install -Dquickly -Prelocations -pl devtools/cli -am + git clone https://github.com/quarkusio/quarkus.git && cd quarkus && ./mvnw -B -s .github/mvn-settings.xml clean install -Dquickly -Prelocations - name: Tar Maven Repo shell: bash run: tar -I 'pigz -9' -cf maven-repo.tgz -C ~ .m2/repository @@ -111,17 +111,13 @@ jobs: - name: Extract Maven Repo shell: bash run: tar -xzf maven-repo.tgz -C ~ - - name: Build Quarkus CLI + - name: Install Quarkus CLI run: | - git clone https://github.com/quarkusio/quarkus.git && cd quarkus/devtools/cli && git checkout 2.7 && mvn -B -s ../../../.github/mvn-settings.xml clean install -Dquickly -Prelocations -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# - name: Install Quarkus CLI -# run: | -# cat < ./quarkus-dev-cli -# #!/bin/bash -# java -jar $PWD/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" -# EOF -# chmod +x ./quarkus-dev-cli + cat < ./quarkus-dev-cli + #!/bin/bash + java -jar ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" + EOF + chmod +x ./quarkus-dev-cli - name: Build with Maven run: | MODULES_MAVEN_PARAM="" @@ -130,9 +126,7 @@ jobs: MODULES_MAVEN_PARAM="-pl ${MODULES_ARG}" fi - mvn -fae -V -B -s .github/mvn-settings.xml clean verify -Dall-modules $MODULES_MAVEN_PARAM -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# mvn -fae -V -B -s .github/mvn-settings.xml clean verify -Dall-modules -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" $MODULES_MAVEN_PARAM + mvn -fae -V -B -s .github/mvn-settings.xml clean verify -Dall-modules -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" $MODULES_MAVEN_PARAM -am - name: Zip Artifacts if: failure() run: | @@ -171,26 +165,21 @@ jobs: - name: Extract Maven Repo shell: bash run: tar -xzf maven-repo.tgz -C ~ -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# - name: Build Quarkus CLI -# run: | -# git clone https://github.com/quarkusio/quarkus.git && cd quarkus/devtools/cli && git checkout 2.7 && mvn -B -s ../../../.github/mvn-settings.xml clean install -Dquickly -Prelocations -# - name: Install Quarkus CLI -# run: | -# cat < ./quarkus-dev-cli -# #!/bin/bash -# java -jar $PWD/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" -# EOF -# chmod +x ./quarkus-dev-cli + - name: Install Quarkus CLI + run: | + cat < ./quarkus-dev-cli + #!/bin/bash + java -jar ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" + EOF + chmod +x ./quarkus-dev-cli - name: Build with Maven run: | if [[ -n ${MODULES_ARG} ]]; then echo "Running modules: ${MODULES_ARG}" mvn -fae -V -B -s .github/mvn-settings.xml -fae -Dall-modules -Dquarkus.container-image.build=false \ - -pl $MODULES_ARG clean verify -Dnative + -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" \ + -pl $MODULES_ARG clean verify -Dnative -am fi -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" - name: Zip Artifacts if: failure() run: | @@ -235,7 +224,7 @@ jobs: MODULES_MAVEN_PARAM="-pl ${MODULES_ARG}" fi - mvn -fae -s .github/mvn-settings.xml clean verify -Dall-modules -Dquarkus.container-image.build=false $MODULES_MAVEN_PARAM + mvn -fae -s .github/mvn-settings.xml clean verify -Dall-modules -Dquarkus.container-image.build=false $MODULES_MAVEN_PARAM -am - name: Zip Artifacts shell: bash if: failure() diff --git a/.github/workflows/daily.yaml b/.github/workflows/daily.yaml index d7f0cde48..606e33733 100644 --- a/.github/workflows/daily.yaml +++ b/.github/workflows/daily.yaml @@ -20,9 +20,9 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.java }} check-latest: true - - name: Build Quarkus 2.7 + - name: Build Quarkus main run: | - git clone https://github.com/quarkusio/quarkus.git && cd quarkus && git checkout 2.7 && ./mvnw -B -s .github/mvn-settings.xml clean install -Dquickly -Prelocations + git clone https://github.com/quarkusio/quarkus.git && cd quarkus && ./mvnw -B -s .github/mvn-settings.xml clean install -Dquickly -Prelocations - name: Tar Maven Repo shell: bash run: tar -I 'pigz -9' -cf maven-repo.tgz -C ~ .m2/repository @@ -60,22 +60,16 @@ jobs: - name: Extract Maven Repo shell: bash run: tar -xzf maven-repo.tgz -C ~ -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# - name: Build Quarkus CLI -# run: | -# git clone https://github.com/quarkusio/quarkus.git && cd quarkus/devtools/cli && git checkout 2.7 && mvn -B -s ../../../.github/mvn-settings.xml clean install -Dquickly -Prelocations -# - name: Install Quarkus CLI -# run: | -# cat < ./quarkus-dev-cli -# #!/bin/bash -# java -jar $PWD/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" -# EOF -# chmod +x ./quarkus-dev-cli + - name: Install Quarkus CLI + run: | + cat < ./quarkus-dev-cli + #!/bin/bash + java -jar ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" + EOF + chmod +x ./quarkus-dev-cli - name: Test in JVM mode run: | - mvn -fae -V -B -s .github/mvn-settings.xml -fae clean verify -P ${{ matrix.profiles }} -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" + mvn -fae -V -B -s .github/mvn-settings.xml -fae clean verify -P ${{ matrix.profiles }} -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" - name: Zip Artifacts if: failure() run: | @@ -118,23 +112,18 @@ jobs: - name: Extract Maven Repo shell: bash run: tar -xzf maven-repo.tgz -C ~ -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# - name: Build Quarkus CLI -# run: | -# git clone https://github.com/quarkusio/quarkus.git && cd quarkus/devtools/cli && git checkout 2.7 && mvn -B -s ../../../.github/mvn-settings.xml clean install -Dquickly -Prelocations -# - name: Install Quarkus CLI -# run: | -# cat < ./quarkus-dev-cli -# #!/bin/bash -# java -jar $PWD/quarkus/devtools/cli/target/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" -# EOF -# chmod +x ./quarkus-dev-cli + - name: Install Quarkus CLI + run: | + cat < ./quarkus-dev-cli + #!/bin/bash + java -jar ~/.m2/repository/io/quarkus/quarkus-cli/999-SNAPSHOT/quarkus-cli-999-SNAPSHOT-runner.jar "\$@" + EOF + chmod +x ./quarkus-dev-cli - name: Test in Native mode run: | mvn -fae -V -B -s .github/mvn-settings.xml -P ${{ matrix.profiles }} -fae clean verify -Dnative \ - -Dquarkus.native.builder-image=quay.io/quarkus/${{ matrix.image }} -# TODO https://github.com/quarkus-qe/quarkus-test-suite/issues/632 -# -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" + -Dquarkus.native.builder-image=quay.io/quarkus/${{ matrix.image }} \ + -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-dev-cli" - name: Zip Artifacts if: failure() run: | diff --git a/pom.xml b/pom.xml index 08702466b..45c252138 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ 2.22.2 quarkus-bom io.quarkus - 2.7.5.Final + 999-SNAPSHOT 1.1.0.Final 0.32.0 2.6.1.Final From ceba931d2b8b77bcef13f8e632c8c9d3c81d9d05 Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 13:12:28 +0200 Subject: [PATCH 2/7] Patch upstream custom stork scenario --- pom.xml | 1 + service-discovery/stork-custom/pom.xml | 23 ++++++++++++++++++ .../ts/stork/custom/SimpleLoadBalancer.java | 2 +- .../custom/SimpleLoadBalancerProvider.java | 6 ++--- .../stork/custom/SimpleServiceDiscovery.java | 2 +- .../SimpleServiceDiscoveryProvider.java | 4 ++-- .../src/main/resources/application.properties | 24 +++++++++---------- ...stomServiceDiscoveryAndLoadBalancerIT.java | 12 +++++----- 8 files changed, 49 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 45c252138..580316e92 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,7 @@ 0.11.5 2.7.1 1.0.2 + 1.1.2 jvm registry.access.redhat.com/ubi8/openjdk-11:latest diff --git a/service-discovery/stork-custom/pom.xml b/service-discovery/stork-custom/pom.xml index d026b7765..756e57b59 100644 --- a/service-discovery/stork-custom/pom.xml +++ b/service-discovery/stork-custom/pom.xml @@ -29,6 +29,29 @@ quarkus-rest-client-reactive + + + + org.apache.maven.plugins + maven-compiler-plugin + ${compiler-plugin.version} + + + + io.quarkus + quarkus-extension-processor + ${quarkus.platform.version} + + + io.smallrye.stork + stork-configuration-generator + ${smallrye-stork.version} + + + + + + diff --git a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancer.java b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancer.java index d3decf1a5..f032254c1 100644 --- a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancer.java +++ b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancer.java @@ -12,7 +12,7 @@ public class SimpleLoadBalancer implements LoadBalancer { private final Random random; - public SimpleLoadBalancer(SimpleLoadBalancerProviderConfiguration config) { + public SimpleLoadBalancer(SimplelbConfiguration config) { random = new Random(); } diff --git a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancerProvider.java b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancerProvider.java index 2dfeedb59..56e66f7a8 100644 --- a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancerProvider.java +++ b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleLoadBalancerProvider.java @@ -5,10 +5,10 @@ import io.smallrye.stork.api.config.LoadBalancerType; import io.smallrye.stork.spi.LoadBalancerProvider; -@LoadBalancerType("simple") -public class SimpleLoadBalancerProvider implements LoadBalancerProvider { +@LoadBalancerType("simplelb") +public class SimpleLoadBalancerProvider implements LoadBalancerProvider { @Override - public LoadBalancer createLoadBalancer(SimpleLoadBalancerProviderConfiguration config, + public LoadBalancer createLoadBalancer(SimplelbConfiguration config, ServiceDiscovery serviceDiscovery) { return new SimpleLoadBalancer(config); } diff --git a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscovery.java b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscovery.java index 2d7a5f317..363ce5886 100644 --- a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscovery.java +++ b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscovery.java @@ -14,7 +14,7 @@ public class SimpleServiceDiscovery implements ServiceDiscovery { private static final Map globalConfig = new HashMap<>(); - public SimpleServiceDiscovery(SimpleServiceDiscoveryProviderConfiguration configuration) { + public SimpleServiceDiscovery(SimpleConfiguration configuration) { Optional .ofNullable(configuration.getPongServiceHost()) .map(host -> globalConfig.put("pongHost", host)); diff --git a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscoveryProvider.java b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscoveryProvider.java index bc66f6eb9..fd8ec88a0 100644 --- a/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscoveryProvider.java +++ b/service-discovery/stork-custom/src/main/java/io/quarkus/ts/stork/custom/SimpleServiceDiscoveryProvider.java @@ -12,10 +12,10 @@ @ServiceDiscoveryAttribute(name = "pongServicePort", description = "Port of the pong service instance.", required = false) @ServiceDiscoveryAttribute(name = "pongReplicaServiceHost", description = "Host name of the pong service instance.", required = true) @ServiceDiscoveryAttribute(name = "pongReplicaServicePort", description = "Port of the pong service instance.", required = false) -public class SimpleServiceDiscoveryProvider implements ServiceDiscoveryProvider { +public class SimpleServiceDiscoveryProvider implements ServiceDiscoveryProvider { @Override public ServiceDiscovery createServiceDiscovery( - SimpleServiceDiscoveryProviderConfiguration config, + SimpleConfiguration config, String serviceName, ServiceConfig serviceConfig, StorkInfrastructure storkInfrastructure) { diff --git a/service-discovery/stork-custom/src/main/resources/application.properties b/service-discovery/stork-custom/src/main/resources/application.properties index 08c6ece26..4b308b71a 100644 --- a/service-discovery/stork-custom/src/main/resources/application.properties +++ b/service-discovery/stork-custom/src/main/resources/application.properties @@ -1,17 +1,17 @@ #Un-comment the following properties if you want to do some verification -#stork.pong.load-balancer=simple -#stork.pong.service-discovery=simple +#quarkus.stork.pong.load-balancer.type=simplelb +#quarkus.stork.pong.service-discovery.type=simple # this properties make sense if you have a global service discovery state as a DB, for this scenario we are going to use an in-memory Map -#stork.pong.service-discovery.host=localhost -#stork.pong.service-discovery.port=8080 -#stork.pong.service-discovery.pongServiceHost=localhost -#stork.pong.service-discovery.pongServicePort=8080 +#quarkus.stork.pong.service-discovery.host=localhost +#quarkus.stork.pong.service-discovery.port=8080 +#quarkus.stork.pong.service-discovery.pongServiceHost=localhost +#quarkus.stork.pong.service-discovery.pongServicePort=8080 -#stork.pong-replica.load-balancer=simple -#stork.pong-replica.service-discovery=simple +#quarkus.stork.pong-replica.load-balancer.type=simplelb +#quarkus.stork.pong-replica.service-discovery.type=simple # this properties make sense if you have a global service discovery state as a DB, for this scenario we are going to use an in-memory Map -#stork.pong-replica.service-discovery.host=localhost -#stork.pong-replica.service-discovery.port=8080 -#stork.pong-replica.service-discovery.pongReplicaServiceHost=localhost -#stork.pong-replica.service-discovery.pongReplicaServicePort=8080 +#quarkus.stork.pong-replica.service-discovery.host=localhost +#quarkus.stork.pong-replica.service-discovery.port=8080 +#quarkus.stork.pong-replica.service-discovery.pongReplicaServiceHost=localhost +#quarkus.stork.pong-replica.service-discovery.pongReplicaServicePort=8080 diff --git a/service-discovery/stork-custom/src/test/java/io/quarkus/ts/stork/custom/StorkCustomServiceDiscoveryAndLoadBalancerIT.java b/service-discovery/stork-custom/src/test/java/io/quarkus/ts/stork/custom/StorkCustomServiceDiscoveryAndLoadBalancerIT.java index c3c2b8520..ee2185b8b 100644 --- a/service-discovery/stork-custom/src/test/java/io/quarkus/ts/stork/custom/StorkCustomServiceDiscoveryAndLoadBalancerIT.java +++ b/service-discovery/stork-custom/src/test/java/io/quarkus/ts/stork/custom/StorkCustomServiceDiscoveryAndLoadBalancerIT.java @@ -40,12 +40,12 @@ public class StorkCustomServiceDiscoveryAndLoadBalancerIT { @QuarkusApplication static RestService mainPingService = new RestService() - .withProperty("stork.pong.load-balancer", "simple") - .withProperty("stork.pong.service-discovery", "simple") - .withProperty("stork.pong-replica.load-balancer", "simple") - .withProperty("stork.pong-replica.service-discovery", "simple") - .withProperty("stork.pong.service-discovery.pongServicePort", () -> "" + pongService.getPort()) - .withProperty("stork.pong-replica.service-discovery.pongReplicaServicePort", + .withProperty("quarkus.stork.pong.load-balancer.type", "simplelb") + .withProperty("quarkus.stork.pong.service-discovery.type", "simple") + .withProperty("quarkus.stork.pong-replica.load-balancer.type", "simplelb") + .withProperty("quarkus.stork.pong-replica.service-discovery.type", "simple") + .withProperty("quarkus.stork.pong.service-discovery.pongServicePort", () -> "" + pongService.getPort()) + .withProperty("quarkus.stork.pong-replica.service-discovery.pongReplicaServicePort", () -> "" + pongReplicaService.getPort()); @Test From 05c0c31190fca4e840107f9998876a6ef5d7ee85 Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 13:25:00 +0200 Subject: [PATCH 3/7] Resolve a properties collision on Qute multi-module --- .../qute-test/src/main/resources/messages/alert_el.properties | 2 -- .../qute-test/src/main/resources/messages/msg_cs.properties | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 qute/multimodule/qute-test/src/main/resources/messages/alert_el.properties delete mode 100644 qute/multimodule/qute-test/src/main/resources/messages/msg_cs.properties diff --git a/qute/multimodule/qute-test/src/main/resources/messages/alert_el.properties b/qute/multimodule/qute-test/src/main/resources/messages/alert_el.properties deleted file mode 100644 index d0c5ce349..000000000 --- a/qute/multimodule/qute-test/src/main/resources/messages/alert_el.properties +++ /dev/null @@ -1,2 +0,0 @@ -withoutParams=Γειά -withParams=Γειά σου {name} \ No newline at end of file diff --git a/qute/multimodule/qute-test/src/main/resources/messages/msg_cs.properties b/qute/multimodule/qute-test/src/main/resources/messages/msg_cs.properties deleted file mode 100644 index bc04e6c3a..000000000 --- a/qute/multimodule/qute-test/src/main/resources/messages/msg_cs.properties +++ /dev/null @@ -1,2 +0,0 @@ -hello=Ahoj! -hello_name=Ahoj {name}! \ No newline at end of file From 6eade230c94be8c231dfa67a40e60b212491a64d Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 13:57:19 +0200 Subject: [PATCH 4/7] Reactive resteasy multipart should return a RestResponse --- .../ts/http/restclient/reactive/files/FileResource.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java index 797326974..d54e2b7f5 100644 --- a/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java +++ b/http/rest-client-reactive/src/main/java/io/quarkus/ts/http/restclient/reactive/files/FileResource.java @@ -10,9 +10,9 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.jboss.resteasy.reactive.MultipartForm; +import org.jboss.resteasy.reactive.RestResponse; import io.quarkus.logging.Log; import io.smallrye.mutiny.Uni; @@ -51,10 +51,10 @@ public Uni uploadMultipart(@MultipartForm FileWrapper body) { @GET @Produces(MediaType.MULTIPART_FORM_DATA) @Path("/download-multipart") - public Response downloadMultipart() { + public RestResponse downloadMultipart() { FileWrapper wrapper = new FileWrapper(); wrapper.file = FILE; - return Response.ok(wrapper).build(); + return RestResponse.ok(wrapper); } @GET From 5b7cdc16deef3b1798539ac24063cb1811cd9e3b Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 14:33:45 +0200 Subject: [PATCH 5/7] Use Confluent kafka registry extension --- messaging/kafka-confluent-avro-reactive-messaging/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messaging/kafka-confluent-avro-reactive-messaging/pom.xml b/messaging/kafka-confluent-avro-reactive-messaging/pom.xml index 026aa052d..56cbfe423 100644 --- a/messaging/kafka-confluent-avro-reactive-messaging/pom.xml +++ b/messaging/kafka-confluent-avro-reactive-messaging/pom.xml @@ -22,7 +22,7 @@ io.quarkus - quarkus-avro + quarkus-confluent-registry-avro From 85426f45576e85432f04c2922af5db6a53b98e06 Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Mon, 23 May 2022 16:23:52 +0200 Subject: [PATCH 6/7] Created app by Quarkus-cli should use a fixed stream --- .../ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java index 828677c0c..e272341bd 100644 --- a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java +++ b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java @@ -226,7 +226,7 @@ public void shouldCreateJacocoReportsFromApplicationOnJvm() { @Test public void verifyRestEasyReactiveAndClassicResteasyCollisionUserMsg() { QuarkusCliRestService app = cliClient.createApplication("dependencyCollision", - defaults().withExtensions("resteasy", "resteasy-reactive")); + defaultWithFixedStream().withExtensions("resteasy", "resteasy-reactive")); Result buildResult = app.buildOnJvm(); From 5454a4ff06a67770b256442d301974579c9a1a4c Mon Sep 17 00:00:00 2001 From: pablo gonzalez granados Date: Tue, 24 May 2022 18:55:53 +0200 Subject: [PATCH 7/7] Support quarkus-cli 999-SNAPSHOT --- .../cli/QuarkusCliCreateJvmApplicationIT.java | 22 ++++++------ .../quarkus/cli/QuarkusCliExtensionsIT.java | 35 +++++++++++++++---- .../quarkus/cli/QuarkusCliSpecialCharsIT.java | 20 +++++++++-- .../ts/quarkus/cli/QuarkusCliUtils.java | 32 +++++++++++++++-- 4 files changed, 86 insertions(+), 23 deletions(-) diff --git a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java index e272341bd..ce30c39bb 100644 --- a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java +++ b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliCreateJvmApplicationIT.java @@ -47,10 +47,10 @@ @DisabledIfSystemProperty(named = "profile.id", matches = "native", disabledReason = "Only for JVM verification") public class QuarkusCliCreateJvmApplicationIT { - static final String RESTEASY_EXTENSION = "quarkus-resteasy"; + static final String RESTEASY_REACTIVE_EXTENSION = "quarkus-resteasy-reactive"; static final String SMALLRYE_HEALTH_EXTENSION = "quarkus-smallrye-health"; static final String SPRING_WEB_EXTENSION = "quarkus-spring-web"; - static final String RESTEASY_JACKSON_EXTENSION = "quarkus-resteasy-jackson"; + static final String RESTEASY_REACTIVE_JACKSON_EXTENSION = "quarkus-resteasy-reactive-jackson"; static final String ROOT_FOLDER = ""; static final String DOCKER_FOLDER = "/src/main/docker"; static final String JDK_11 = "11"; @@ -78,7 +78,6 @@ public void shouldCreateApplicationOnJvm() { @Tag("QUARKUS-1472") @Test - @Disabled("https://github.com/quarkusio/quarkus/issues/24613") public void createAppShouldAutoDetectJavaVersion() { QuarkusCliRestService app = cliClient.createApplication("app", defaultWithFixedStream()); assertExpectedJavaVersion(getFileFromApplication(app, ROOT_FOLDER, "pom.xml"), getSystemJavaVersion()); @@ -152,12 +151,13 @@ public void shouldCreateApplicationOnJvmFromMultipleBoms() { final String kogitoExtension = "kogito-quarkus-rules"; final String prettytimeExtension = "quarkus-prettytime"; QuarkusCliRestService app = cliClient.createApplication("app", defaultWithFixedStream().withExtensions(kogitoExtension, - prettytimeExtension, RESTEASY_EXTENSION, RESTEASY_JACKSON_EXTENSION)); + prettytimeExtension, RESTEASY_REACTIVE_EXTENSION, RESTEASY_REACTIVE_JACKSON_EXTENSION)); // Should build on Jvm Result result = app.buildOnJvm(); assertTrue(result.isSuccessful(), "The application didn't build on JVM. Output: " + result.getOutput()); - assertInstalledExtensions(app, kogitoExtension, prettytimeExtension, RESTEASY_EXTENSION, RESTEASY_JACKSON_EXTENSION); + assertInstalledExtensions(app, kogitoExtension, prettytimeExtension, RESTEASY_REACTIVE_EXTENSION, + RESTEASY_REACTIVE_JACKSON_EXTENSION); } @Tag("QUARKUS-1071") @@ -165,10 +165,10 @@ public void shouldCreateApplicationOnJvmFromMultipleBoms() { public void shouldCreateApplicationWithCodeStarter() { // Create application with Resteasy Jackson + Spring Web (we need both for the app to run) QuarkusCliRestService app = cliClient.createApplication("app", - defaultWithFixedStream().withExtensions(RESTEASY_JACKSON_EXTENSION, SPRING_WEB_EXTENSION)); + defaultWithFixedStream().withExtensions(RESTEASY_REACTIVE_JACKSON_EXTENSION, SPRING_WEB_EXTENSION)); - // Verify By default, it installs only "quarkus-resteasy-jackson" and "quarkus-spring-web" - assertInstalledExtensions(app, RESTEASY_JACKSON_EXTENSION, SPRING_WEB_EXTENSION); + // Verify By default, it installs only "quarkus-resteasy-reactive-jackson" and "quarkus-spring-web" + assertInstalledExtensions(app, RESTEASY_REACTIVE_JACKSON_EXTENSION, SPRING_WEB_EXTENSION); // Start using DEV mode app.start(); @@ -183,14 +183,14 @@ public void shouldAddAndRemoveExtensions() { QuarkusCliRestService app = cliClient.createApplication("app", defaults().withPlatformBom(gav)); // By default, it installs only "quarkus-resteasy" - assertInstalledExtensions(app, RESTEASY_EXTENSION); + assertInstalledExtensions(app, RESTEASY_REACTIVE_EXTENSION); // Let's install Quarkus SmallRye Health Result result = app.installExtension(SMALLRYE_HEALTH_EXTENSION); assertTrue(result.isSuccessful(), SMALLRYE_HEALTH_EXTENSION + " was not installed. Output: " + result.getOutput()); // Verify both extensions now - assertInstalledExtensions(app, RESTEASY_EXTENSION, SMALLRYE_HEALTH_EXTENSION); + assertInstalledExtensions(app, RESTEASY_REACTIVE_EXTENSION, SMALLRYE_HEALTH_EXTENSION); // The health endpoint should be now available app.start(); @@ -210,7 +210,7 @@ public void shouldAddAndRemoveExtensions() { @Test public void shouldCreateJacocoReportsFromApplicationOnJvm() { QuarkusCliRestService app = cliClient.createApplication("app-with-jacoco", - defaultWithFixedStream().withExtensions("jacoco")); + defaultWithFixedStream().withExtensions("resteasy", "jacoco")); Result result = app.buildOnJvm(); assertTrue(result.isSuccessful(), "The application didn't build on JVM. Output: " + result.getOutput()); diff --git a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliExtensionsIT.java b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliExtensionsIT.java index 864f4835e..ec2fd6363 100644 --- a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliExtensionsIT.java +++ b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliExtensionsIT.java @@ -1,6 +1,7 @@ package io.quarkus.ts.quarkus.cli; import static io.quarkus.ts.quarkus.cli.QuarkusCliUtils.getCurrentStreamVersion; +import static io.quarkus.ts.quarkus.cli.QuarkusCliUtils.isUpstream; import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; @@ -44,31 +45,39 @@ public class QuarkusCliExtensionsIT { @Test public void shouldListExtensionsUsingDefaults() { - whenGetListExtensions("--stream", getCurrentStreamVersion()); + whenGetListExtensions(getDefaultAppArgs().toArray(new String[0])); assertListDefaultOptionOutput(); } @Test public void shouldListExtensionsUsingName() { - whenGetListExtensions("--stream", getCurrentStreamVersion(), "--name"); + List args = getDefaultAppArgs(); + args.add("--name"); + whenGetListExtensions(args.toArray(new String[0])); assertListNameOptionOutput(); } @Test public void shouldListExtensionsUsingOrigins() { - whenGetListExtensions("--stream", getCurrentStreamVersion(), "--origins"); + List args = getDefaultAppArgs(); + args.add("--origins"); + whenGetListExtensions(args.toArray(new String[0])); assertListOriginsOptionOutput(); } @Test public void shouldListExtensionsUsingConcise() { - whenGetListExtensions("--stream", getCurrentStreamVersion(), "--concise"); + List args = getDefaultAppArgs(); + args.add("--concise"); + whenGetListExtensions(args.toArray(new String[0])); assertListConciseOptionOutput(); } @Test public void shouldListExtensionsUsingFull() { - whenGetListExtensions("--stream", getCurrentStreamVersion(), "--full"); + List args = getDefaultAppArgs(); + args.add("--full"); + whenGetListExtensions(args.toArray(new String[0])); assertListFullOptionOutput(); } @@ -103,7 +112,9 @@ public void shouldListExtensionsUsingStream() { @Test public void shouldListExtensionsUsingInstallable() { - whenGetListExtensions("--stream", getCurrentStreamVersion(), "--installable"); + List args = getDefaultAppArgs(); + args.add("--installable"); + whenGetListExtensions(args.toArray(new String[0])); assertListDefaultOptionOutput(); } @@ -158,4 +169,14 @@ private void assertListFullOptionOutput() { private void assertResultIsSuccessful() { assertTrue(result.isSuccessful(), "Extensions list command didn't work. Output: " + result.getOutput()); } -} \ No newline at end of file + + private List getDefaultAppArgs() { + String version = getCurrentStreamVersion(); + List args = new ArrayList<>(); + if (!isUpstream(version)) { + args.addAll(Arrays.asList("--stream", version)); + } + + return args; + } +} diff --git a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliSpecialCharsIT.java b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliSpecialCharsIT.java index 10a095b8a..a7062bf2a 100644 --- a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliSpecialCharsIT.java +++ b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliSpecialCharsIT.java @@ -1,9 +1,13 @@ package io.quarkus.ts.quarkus.cli; import static io.quarkus.ts.quarkus.cli.QuarkusCliUtils.getCurrentStreamVersion; +import static io.quarkus.ts.quarkus.cli.QuarkusCliUtils.isUpstream; import static org.junit.jupiter.api.Assertions.assertTrue; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import javax.inject.Inject; @@ -131,8 +135,9 @@ private void whenBuildOnJvmAppAt(String folder) { } private void whenCreateAppAt(String folder) { - result = cliClient.run("create", "app", "--stream", getCurrentStreamVersion(), "--output-directory=" + folder, - ARTIFACT_ID); + List args = getDefaultAppArgs("create", "app"); + args.addAll(List.of("--output-directory=" + folder, ARTIFACT_ID)); + result = cliClient.run(args.toArray(new String[args.size()])); } private void thenResultIsSuccessful() { @@ -148,4 +153,15 @@ private void deleteFolder(String folder) { FileUtils.deletePath(TARGET.resolve(folder)); } + private List getDefaultAppArgs(String... defaultArgs) { + String version = getCurrentStreamVersion(); + List args = new ArrayList<>(); + args.addAll(List.of(defaultArgs)); + if (!isUpstream(version)) { + args.addAll(Arrays.asList("--stream", version)); + } + + return args; + } + } diff --git a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliUtils.java b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliUtils.java index 036167bc6..357d3edbb 100644 --- a/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliUtils.java +++ b/quarkus-cli/src/test/java/io/quarkus/ts/quarkus/cli/QuarkusCliUtils.java @@ -4,21 +4,47 @@ import java.util.regex.Pattern; +import org.jboss.logging.Logger; + import io.quarkus.builder.Version; import io.quarkus.test.bootstrap.QuarkusCliClient; public class QuarkusCliUtils { + public static final String QUARKUS_UPSTREAM_VERSION = "999-SNAPSHOT"; + private static final Logger LOG = Logger.getLogger(QuarkusCliUtils.class); + public static QuarkusCliClient.CreateApplicationRequest defaultWithFixedStream() { - return defaults().withStream(getCurrentStreamVersion()); + String version = getCurrentStreamVersion(); + if (isUpstream(version)) { + LOG.warn("fixed streams are not supported on upstream"); + return defaults(); + } + + return defaults().withStream(version); } public static QuarkusCliClient.CreateExtensionRequest defaultNewExtensionArgsWithFixedStream() { - return QuarkusCliClient.CreateExtensionRequest.defaults().withStream(getCurrentStreamVersion()); + String version = getCurrentStreamVersion(); + if (isUpstream(version)) { + LOG.warn("fixed streams are not supported on upstream"); + return QuarkusCliClient.CreateExtensionRequest.defaults(); + } + + return QuarkusCliClient.CreateExtensionRequest.defaults().withStream(version); + } + + public static boolean isUpstream(String version) { + return version.equalsIgnoreCase(QUARKUS_UPSTREAM_VERSION); } public static String getCurrentStreamVersion() { - String[] version = Version.getVersion().split(Pattern.quote(".")); + String rawVersion = Version.getVersion(); + if (QUARKUS_UPSTREAM_VERSION.equalsIgnoreCase(rawVersion)) { + return QUARKUS_UPSTREAM_VERSION; + } + + String[] version = rawVersion.split(Pattern.quote(".")); return String.format("%s.%s", version[0], version[1]); } }