Skip to content

Commit

Permalink
Merge pull request #1991 from TimonCzech/Added-isRHBQ-method
Browse files Browse the repository at this point in the history
Added isRHBQ method to check if the version contains string redhat
  • Loading branch information
jedla97 authored Sep 12, 2024
2 parents 67590af + 9aa87d9 commit 547f3d3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
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

0 comments on commit 547f3d3

Please sign in to comment.