Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.8] Backports 4th of September #1971

Merged
merged 18 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
check-latest: true
- name: Build with Maven
run: |
mvn -V -B -s .github/mvn-settings.xml verify -Dall-modules -Dvalidate-format -DskipTests -DskipITs -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
mvn -V -B --no-transfer-progress -s .github/mvn-settings.xml verify -Dall-modules -Dvalidate-format -DskipTests -DskipITs -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
detect-test-suite-modules:
name: Detect Modules in PR
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,8 +52,8 @@ jobs:
echo "MODULES_ARG=$MODULES_ARG" >> $GITHUB_OUTPUT
outputs:
MODULES_ARG: ${{ steps.detect-changes.outputs.MODULES_ARG }}
prepare-jvm-latest-modules-mvn-param:
name: Prepare Maven Params For Linux JVM Build
prepare-jvm-native-latest-modules-mvn-param:
name: Prepare Maven Params For Linux JVM and native Build
runs-on: ubuntu-latest
needs: [ detect-test-suite-modules ]
env:
Expand All @@ -63,22 +63,28 @@ jobs:
run: |
if [[ -n ${MODULES_ARG} ]]; then
echo "Running modules: ${MODULES_ARG}"
echo "MODULES_MAVEN_PARAM=[\" -pl ${MODULES_ARG} -Dall-modules\"]" >> $GITHUB_OUTPUT
echo "JVM_MODULES_MAVEN_PARAM=[\" -pl ${MODULES_ARG} -Dall-modules\"]" >> $GITHUB_OUTPUT
echo "NATIVE_MODULES_MAVEN_PARAM=[\" -pl ${MODULES_ARG} -Dall-modules\"]" >> $GITHUB_OUTPUT
else
echo "MODULES_MAVEN_PARAM=[' -P root-modules,cache-modules,spring-modules,http-modules,test-tooling-modules', ' -P security-modules,sql-db-modules,messaging-modules,websockets-modules,monitoring-modules']" >> $GITHUB_OUTPUT
echo "JVM_MODULES_MAVEN_PARAM=[' -P root-modules,cache-modules,spring-modules,http-modules,test-tooling-modules,messaging-modules,monitoring-modules', ' -P security-modules,sql-db-modules,websockets-modules']" >> $GITHUB_OUTPUT
echo "NATIVE_MODULES_MAVEN_PARAM=[' -P root-modules,websockets-modules,test-tooling-modules,nosql-db-modules', ' -P http-modules,cache-modules', ' -P security-modules,spring-modules',
' -P sql-db-modules -pl env-info,sql-db/hibernate,sql-db/sql-app,sql-db/sql-app-compatibility,sql-db/multiple-pus,sql-db/panache-flyway,sql-db/hibernate-reactive',
' -P sql-db-modules -pl env-info,sql-db/reactive-rest-data-panache,sql-db/vertx-sql,sql-db/reactive-vanilla,sql-db/hibernate-fulltext-search,sql-db/narayana-transactions',
' -P messaging-modules,monitoring-modules']" | tr -d -s '\n' ' ' >> $GITHUB_OUTPUT
fi
outputs:
MODULES_MAVEN_PARAM: ${{ steps.prepare-modules-mvn-param.outputs.MODULES_MAVEN_PARAM }}
JVM_MODULES_MAVEN_PARAM: ${{ steps.prepare-modules-mvn-param.outputs.JVM_MODULES_MAVEN_PARAM }}
NATIVE_MODULES_MAVEN_PARAM: ${{ steps.prepare-modules-mvn-param.outputs.NATIVE_MODULES_MAVEN_PARAM }}
linux-build-jvm-latest:
name: PR - Linux - JVM build - 3.8
runs-on: ubuntu-latest
timeout-minutes: 240
needs: prepare-jvm-latest-modules-mvn-param
needs: prepare-jvm-native-latest-modules-mvn-param
strategy:
matrix:
java: [ 17 ]
cli: [ 3.8.6 ]
module-mvn-args: ${{ fromJSON(needs.prepare-jvm-latest-modules-mvn-param.outputs.MODULES_MAVEN_PARAM) }}
module-mvn-args: ${{ fromJSON(needs.prepare-jvm-native-latest-modules-mvn-param.outputs.JVM_MODULES_MAVEN_PARAM) }}
outputs:
has-flaky-tests: ${{steps.flaky-test-detector.outputs.has-flaky-tests}}
steps:
Expand All @@ -101,7 +107,7 @@ jobs:
./quarkus-cli-${{ matrix.cli }}/bin/quarkus version
- name: Build with Maven
run: |
mvn -fae -V -B -s .github/mvn-settings.xml clean verify -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-cli-${{ matrix.cli }}/bin/quarkus"${{ matrix.module-mvn-args }} -am
mvn -fae -V -B --no-transfer-progress -s .github/mvn-settings.xml clean verify -Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-cli-${{ matrix.cli }}/bin/quarkus"${{ matrix.module-mvn-args }} -am -DexcludedGroups=long-running
- name: Detect flaky tests
id: flaky-test-detector
if: ${{ hashFiles('**/flaky-run-report.json') != '' }}
Expand All @@ -118,13 +124,12 @@ jobs:
linux-build-native-latest:
name: PR - Linux - Native build - 3.8
runs-on: ubuntu-latest
needs: detect-test-suite-modules
env:
MODULES_ARG: ${{ needs.detect-test-suite-modules.outputs.MODULES_ARG }}
needs: prepare-jvm-native-latest-modules-mvn-param
strategy:
matrix:
java: [ 17 ]
cli: [ 3.8.6 ]
module-mvn-args: ${{ fromJSON(needs.prepare-jvm-native-latest-modules-mvn-param.outputs.NATIVE_MODULES_MAVEN_PARAM) }}
outputs:
has-flaky-tests: ${{steps.flaky-test-detector.outputs.has-flaky-tests}}
steps:
Expand All @@ -147,13 +152,10 @@ jobs:
./quarkus-cli-${{ matrix.cli }}/bin/quarkus version
- 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 \
mvn -fae -V -B --no-transfer-progress -s .github/mvn-settings.xml -fae \
-Dquarkus.native.native-image-xmx=5g \
-Dinclude.quarkus-cli-tests -Dts.quarkus.cli.cmd="${PWD}/quarkus-cli-${{ matrix.cli }}/bin/quarkus" \
-pl $MODULES_ARG clean verify -Dnative -am
fi
${{ matrix.module-mvn-args }} clean verify -Dnative -am -DexcludedGroups=long-running
- name: Detect flaky tests
id: flaky-test-detector
if: ${{ hashFiles('**/flaky-run-report.json') != '' }}
Expand Down Expand Up @@ -196,7 +198,7 @@ jobs:
MODULES_MAVEN_PARAM="-pl ${MODULES_ARG}"
fi

mvn -B -fae -s .github/mvn-settings.xml clean verify -Dall-modules $MODULES_MAVEN_PARAM -am
mvn -B --no-transfer-progress -fae -s .github/mvn-settings.xml clean verify -Dall-modules $MODULES_MAVEN_PARAM -am -DexcludedGroups=long-running
- name: Detect flaky tests
id: flaky-test-detector
if: ${{ hashFiles('**/flaky-run-report.json') != '' }}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ The suite uses `org.junit.jupiter.api.Tag` annotation to group similar tests tog
- `serverless`: use Openshift Serverless to deploy the app
- `quarkus-cli`: tests use Quarkus CLI, which needs to be installed ( see https://quarkus.io/guides/cli-tooling for details)
- `podman-incompatible`: tests, which require Docker as a container engine and are not compatible with Podman.
- `long-running`: tests, which run for a long time and therefore are disabled in PR CI

## Running against Red Hat build of Quarkus

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@ private void validateExtensions(QuarkusCliRestService app, JsonPath json) {
.map(payloadExtension -> mapToGA(payloadExtension.getGroupId(), payloadExtension.getArtifactId()))
.collect(Collectors.toList());
assertEquals(pomDependencyGAs, payloadExtensionGAs);
List<PayloadExtension> extensionsWithMismatchedVersion = payloadExtensions.stream()
.filter(extension -> !QUARKUS_EXTENSION_VERSION_PATTERN.matcher(extension.getVersion()).matches())
.collect(Collectors.toList());
assertEquals(0, extensionsWithMismatchedVersion.size(),
String.format("All extensions versions must match pattern: '%s'. Offending extensions: %s",
QUARKUS_EXTENSION_VERSION_PATTERN.pattern(), extensionsWithMismatchedVersion));

// RHBQ doesn't guarantee the same version of the platform and core extensions
boolean isRHBQ = QuarkusProperties.getVersion().contains("redhat");
if (!isRHBQ) {
List<PayloadExtension> extensionsWithMismatchedVersion = payloadExtensions.stream()
.filter(extension -> !QUARKUS_EXTENSION_VERSION_PATTERN.matcher(extension.getVersion()).matches())
.collect(Collectors.toList());
assertEquals(0, extensionsWithMismatchedVersion.size(),
String.format("All extensions versions must match pattern: '%s'. Offending extensions: %s",
QUARKUS_EXTENSION_VERSION_PATTERN.pattern(), extensionsWithMismatchedVersion));
}
}

private List<Dependency> getPomDependencies(QuarkusCliRestService app) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
Expand All @@ -28,7 +27,6 @@
import io.quarkus.test.services.knative.eventing.spi.ForwardResponseDTO;
import io.restassured.common.mapper.TypeRef;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@DisabledOnNative(reason = "https://github.com/quarkusio/quarkus/issues/37142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import static io.restassured.RestAssured.given;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtensionAndDockerBuildStrategy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import static io.restassured.RestAssured.given;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtension)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import static io.restassured.RestAssured.given;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtensionAndDockerBuildStrategy)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import static io.restassured.RestAssured.given;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtension)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.redhat; // this bug can not be reproduced for classes in io.quarkus package

import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.Response;

import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import io.quarkus.rest.client.reactive.ClientExceptionMapper;
import io.smallrye.common.annotation.Blocking;

/**
* Reproducer for compilation failure
* See https://github.com/quarkusio/quarkus/issues/38275#issuecomment-2115117993
*/
@RegisterRestClient
public interface BrokenBlockingApi {
@GET
@Path("/")
String request();

@Blocking
@ClientExceptionMapper
static RuntimeException toException(Response response) {
String entity = response.readEntity(String.class).isEmpty()
? response.getStatusInfo().getReasonPhrase()
: response.readEntity(String.class);
return new RuntimeException(entity);
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package io.quarkus.ts.vertx;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.QuarkusApplication;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtensionAndDockerBuildStrategy)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package io.quarkus.ts.vertx;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftDeploymentStrategy;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.QuarkusApplication;
import io.restassured.specification.RequestSpecification;

@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1142")
@Tag("use-quarkus-openshift-extension")
@Tag("serverless")
@OpenShiftScenario(deployment = OpenShiftDeploymentStrategy.UsingOpenShiftExtension)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package io.quarkus.ts.messaging.amqpreactive;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftScenario;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1144")
public class OpenShiftProdAmqpReactiveIT extends ProdAmqpReactiveIT {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package io.quarkus.ts.messaging.cloudevents.amqpbinary;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftScenario;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1144")
public class OpenShiftBinaryCloudEventsOverProdAmqpIT extends BinaryCloudEventsOverProdAmqpIT {
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package io.quarkus.ts.messaging.cloudevents.amqpjson;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.scenarios.OpenShiftScenario;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1144")
public class OpenShiftJSONCloudEventsOverProdAmqpIT extends JSONCloudEventsOverProdAmqpIT {
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;

import io.smallrye.mutiny.Uni;

@Path("/slow-topic")
public class SlowTopicResource {

Expand All @@ -22,4 +24,11 @@ public void sendMessage(@PathParam("count") Integer count) {
emitter.send("Message " + index);
}
}

@POST
@Path("/sendMessage/{content}")
public Uni<Void> sendMessage(@PathParam("content") String message) {
return Uni.createFrom().completionStage(emitter.send(message));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;

import org.apache.kafka.clients.admin.AdminClient;
import org.apache.kafka.clients.admin.NewTopic;
import org.apache.logging.log4j.util.Strings;
import org.jboss.logmanager.Level;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
Expand Down Expand Up @@ -39,6 +43,19 @@ public class KafkaGratefulShutdownIT {
@KafkaContainer(vendor = KafkaVendor.STRIMZI)
static KafkaService kafka = new KafkaService();

/**
* If topic is not created before the test, messages inside it will not be processed.
* for details and todo see https://github.com/quarkusio/quarkus/issues/41441
*/
private void createTopic(KafkaService service) throws InterruptedException {
Properties properties = new Properties();
properties.put("bootstrap.servers", service.getBootstrapUrl());
try (AdminClient client = AdminClient.create(properties)) {
client.createTopics(List.of(new NewTopic("slow", 1, (short) 1)));
}
Thread.sleep(1000);
}

@QuarkusApplication(classes = { SlowTopicConsumer.class,
SlowTopicResource.class }, properties = "kafka.grateful.shutdown.application.properties")
static RestService app = new RestService()
Expand All @@ -48,6 +65,14 @@ public class KafkaGratefulShutdownIT {

@Order(1)
@Test
public void testConnection() throws InterruptedException {
createTopic(kafka);
app.given().post("/slow-topic/sendMessage/ave").then().statusCode(200);
app.logs().assertContains("ave");
}

@Order(2)
@Test
public void shouldWaitForMessagesWhenGratefulShutdownIsEnabled() throws InterruptedException {
givenMessagesInTopic();
if (OS.current() == OS.WINDOWS) {
Expand All @@ -57,7 +82,7 @@ public void shouldWaitForMessagesWhenGratefulShutdownIsEnabled() throws Interrup
thenAllMessagesAreProcessedOrKafkaIsShutdown();
}

@Order(2)
@Order(3)
@Test
public void shouldNotWaitForMessagesWhenGratefulShutdownIsDisabled() {
givenApplicationWithGratefulShutdownDisabled();
Expand Down Expand Up @@ -98,7 +123,7 @@ private void thenAssertLogs(Predicate<String> assertion, String message) {
await().atMost(3, TimeUnit.SECONDS).untilAsserted(() -> {
List<String> elements = app.getLogs();

assertTrue(elements.stream().anyMatch(assertion), message + ":" + elements);
assertTrue(elements.stream().anyMatch(assertion), message + ":" + Strings.join(elements, '\n'));
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import io.quarkus.test.services.containers.model.KafkaVendor;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1144")
@DisabledIfSystemProperty(named = "ts.ibm-z-p.missing.services.excludes", matches = "true", disabledReason = "debezium/zookeeper container not available on s390x & ppc64le.")
@EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true")
public class OpenShiftAmqStreamsKafkaStreamIT extends BaseKafkaStreamTest {
Expand Down
Loading