Skip to content

Commit

Permalink
Merge pull request #1899 from rsvoboda/fix-version-assumption
Browse files Browse the repository at this point in the history
Fix platform and core version assumption for buildtimeanalytics tests
  • Loading branch information
michalvavrik authored Jul 23, 2024
2 parents 569452e + c835ef5 commit 46d927e
Showing 1 changed file with 11 additions and 6 deletions.
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

0 comments on commit 46d927e

Please sign in to comment.