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

Added isRHBQ method to check if the version contains string redhat #1991

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ private void validateExtensions(QuarkusCliRestService app, JsonPath json) {
assertEquals(pomDependencyGAs, payloadExtensionGAs);

// RHBQ doesn't guarantee the same version of the platform and core extensions
boolean isRHBQ = QuarkusProperties.getVersion().contains("redhat");
if (!isRHBQ) {
if (!QuarkusProperties.isRHBQ()) {
List<PayloadExtension> extensionsWithMismatchedVersion = payloadExtensions.stream()
.filter(extension -> !QUARKUS_EXTENSION_VERSION_PATTERN.matcher(extension.getVersion()).matches())
.collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DisabledOnRHBQAarch64NativeConditions implements ExecutionCondition

@Override
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) {
boolean isRHBQ = QuarkusProperties.getVersion().contains("redhat");
boolean isRHBQ = QuarkusProperties.isRHBQ();
boolean isNative = QuarkusProperties.isNativeEnabled();
boolean isAarch64 = "true".equals(System.getProperty("ts.arm.missing.services.excludes"));
if (isRHBQ && isAarch64 && isNative) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class DisabledOnRHBQWindowsConditions implements ExecutionCondition {

@Override
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) {
boolean isRHBQ = QuarkusProperties.getVersion().contains("redhat");
boolean isRHBQ = QuarkusProperties.isRHBQ();
boolean isWindows = OS.current().equals(OS.WINDOWS);
if (isRHBQ && isWindows) {
return ConditionEvaluationResult.disabled("It is RHBQ on Windows");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void shouldListExtensionsUsingPlatformBom() {
public void shouldListExtensionsUsingStream() {
var req = ListExtensionRequest.withSetStream();
result = cliClient.listExtensions(req, "--origins");
if (QuarkusProperties.getVersion().contains("redhat")) {
if (QuarkusProperties.isRHBQ()) {
assertTrue(result.getOutput().contains("com.redhat.quarkus.platform:quarkus-bom:" + req.stream()));
} else {
assertTrue(result.getOutput().contains("io.quarkus.platform:quarkus-bom:" + req.stream()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public AbstractQuarkusCliUpdateIT(DefaultArtifactVersion oldVersionStream, Defau
}

protected IQuarkusCLIAppManager createAppManager() {
if (this.newVersionFromProperties != null && this.newVersionFromProperties.contains("redhat")) {
if (this.newVersionFromProperties != null && QuarkusProperties.isRHBQ()) {
return new RHBQPlatformAppManager(cliClient, oldVersionStream, newVersionStream,
new DefaultArtifactVersion(newVersionFromProperties));
}
Expand All @@ -71,7 +71,7 @@ public void versionUpdateTest() throws IOException, XmlPullParserException {
assertEquals(newVersionStream.getMinorVersion(), updatedVersion.getMinorVersion(),
"Minor version for app updated to " + newVersionStream + " should be " + newVersionStream.getMinorVersion());
// check that updated app is using RHBQ, if we're testing with RHBQ
if (QuarkusProperties.getVersion().contains("redhat")) {
if (QuarkusProperties.isRHBQ()) {
assertTrue(updatedVersion.toString().contains("redhat"),
"Updated app is not using \"redhat\" version. Found version: " + updatedVersion);
}
Expand Down