Skip to content

Commit

Permalink
Use Quarkus platform version from system variable
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Feb 12, 2024
1 parent 2d7de65 commit 792c54c
Showing 1 changed file with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.quarkus.ts.startstop.utils.Commands;
import org.jboss.logging.Logger;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.TestInfo;
Expand All @@ -25,6 +26,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static io.quarkus.ts.startstop.utils.Commands.getQuarkusVersion;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -130,21 +132,8 @@ public void validatePresenceOfStreamVersionSelect(TestInfo testInfo) {

@Test
public void validateQuarkusVersionMatch(TestInfo testInfo) {
String quarkusPlatformVersion = "";
if(System.getProperty("maven.repo.local") == null){
LOGGER.warn("System property 'maven.repo.local' is not specified. Skip test execution.");
return;
}
Path quarkusProductBomPath = Paths.get(System.getProperty("maven.repo.local")).resolve("com/redhat/quarkus/platform/quarkus-bom");
try (Stream<Path> paths = Files.list(quarkusProductBomPath)) {
List<String> folders = paths.filter(Files::isDirectory)
.map(path -> path.getFileName().toString())
.sorted()
.collect(Collectors.toList());
quarkusPlatformVersion = folders.get(folders.size() - 1); // get the last directory from the sorted list
} catch (IOException e) {
throw new UncheckedIOException(e);
}
String quarkusPlatformVersion = getQuarkusVersion();
Assumptions.assumeTrue(quarkusPlatformVersion.contains("redhat"));

Page page = loadPage(webPageUrl, 60);
LOGGER.info("Trying to find element: " + elementQuarkusPlatformVersionByXpath);
Expand Down

0 comments on commit 792c54c

Please sign in to comment.