Skip to content

Commit

Permalink
Add v3.2 to quarkus.io sample used for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Mar 27, 2024
1 parent 35527a1 commit 45a19c4
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/quarkus/search/app/QuarkusVersions.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ private QuarkusVersions() {

public static final String LATEST = "latest";
public static final String MAIN = "main";
public static final String V3_2 = "3.2";

}
6 changes: 3 additions & 3 deletions src/test/java/io/quarkus/search/app/SearchServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void projections() {
void version() {
var result = given()
.queryParam("q", "orm")
.queryParam("version", QuarkusIOSample.SAMPLED_NON_LATEST_VERSION)
.queryParam("version", QuarkusVersions.MAIN)
.when().get(GUIDES_SEARCH)
.then()
.statusCode(200)
Expand All @@ -270,7 +270,7 @@ void version() {
.asString()
.satisfiesAnyOf(
uri -> assertThat(uri).startsWith("https://quarkus.io/version/"
+ QuarkusIOSample.SAMPLED_NON_LATEST_VERSION + "/guides/"),
+ QuarkusVersions.MAIN + "/guides/"),
uri -> assertThat(uri).startsWith("https://quarkiverse.github.io/quarkiverse-docs")));
result = given()
.queryParam("q", "orm")
Expand All @@ -292,7 +292,7 @@ void version() {
void quarkiverse() {
var result = given()
.queryParam("q", "amazon")
.queryParam("version", QuarkusIOSample.SAMPLED_NON_LATEST_VERSION)
.queryParam("version", QuarkusVersions.MAIN)
.when().get(GUIDES_SEARCH)
.then()
.statusCode(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public final class QuarkusIOSample {
private QuarkusIOSample() {
}

public static final String SAMPLED_NON_LATEST_VERSION = QuarkusVersions.MAIN;
public static final List<String> SAMPLED_VERSIONS = List.of(QuarkusVersions.LATEST, QuarkusVersions.MAIN,
QuarkusVersions.V3_2);

private static Path testResourcesSamplePath() {
return Path.of(System.getProperty("maven.project.testResourceDirectory", "src/test/resources"))
Expand Down Expand Up @@ -382,12 +383,14 @@ protected AbstractGuideRefSetFilterDefinition(String name, GuideRef... guides) {

@Override
public void define(FilterDefinitionCollector c) {
c.addMetadata(QuarkusVersions.LATEST, guides);
c.addMetadata(SAMPLED_NON_LATEST_VERSION, guides);
c.addQuarkiverseMetadata(SAMPLED_NON_LATEST_VERSION);
for (GuideRef guideRef : guides) {
c.addGuide(guideRef);
c.addGuide(guideRef, SAMPLED_NON_LATEST_VERSION);
for (String version : SAMPLED_VERSIONS) {
c.addMetadata(version, guides);
if (QuarkusVersions.MAIN.equals(version)) {
c.addQuarkiverseMetadata(version);
}
for (GuideRef guideRef : guides) {
c.addGuide(guideRef, version);
}
}
}
}
Expand All @@ -402,12 +405,14 @@ public AllLocalizedFilterDefinition(Language language) {

@Override
public void define(FilterDefinitionCollector c) {
c.addLocalizedMetadata(language, QuarkusVersions.LATEST);
c.addLocalizedMetadata(language, SAMPLED_NON_LATEST_VERSION);
c.addLocalizedQuarkiverseMetadata(language, SAMPLED_NON_LATEST_VERSION);
for (GuideRef guideRef : GuideRef.local()) {
c.addLocalizedGuide(language, guideRef, QuarkusVersions.LATEST);
c.addLocalizedGuide(language, guideRef, SAMPLED_NON_LATEST_VERSION);
for (String version : SAMPLED_VERSIONS) {
c.addLocalizedMetadata(language, version);
if (QuarkusVersions.MAIN.equals(version)) {
c.addLocalizedQuarkiverseMetadata(language, version);
}
for (GuideRef guideRef : GuideRef.local()) {
c.addLocalizedGuide(language, guideRef, version);
}
}
}
}
Expand Down Expand Up @@ -453,15 +458,16 @@ public FilterDefinitionCollector addLocalizedGuide(Language language, GuideRef r
}

public FilterDefinitionCollector addLocalizedMetadata(Language language, String version) {
return addLocalizedMetadata(language, version, "quarkus.yaml.po");
String metadataPath = Path.of("l10n", "po", language.locale)
.resolve(QuarkusIO.yamlMetadataPath(version) + ".po")
.toString();
addOnSourceBranch(metadataPath, metadataPath);
return this;
}

public FilterDefinitionCollector addLocalizedQuarkiverseMetadata(Language language, String version) {
return addLocalizedMetadata(language, version, "quarkiverse.yaml.po");
}

private FilterDefinitionCollector addLocalizedMetadata(Language language, String version, String filename) {
String metadataPath = Path.of("l10n", "po", language.locale, "_data", "versioned", version, "index", filename)
String metadataPath = Path.of("l10n", "po", language.locale)
.resolve(QuarkusIO.yamlQuarkiverseMetadataPath(version) + ".po")
.toString();
addOnSourceBranch(metadataPath, metadataPath);
return this;
Expand Down
Binary file modified src/test/resources/quarkusio-sample-cn.zip
Binary file not shown.
Binary file modified src/test/resources/quarkusio-sample-es.zip
Binary file not shown.
Binary file modified src/test/resources/quarkusio-sample-ja.zip
Binary file not shown.
Binary file modified src/test/resources/quarkusio-sample-pt.zip
Binary file not shown.
Binary file modified src/test/resources/quarkusio-sample.zip
Binary file not shown.

0 comments on commit 45a19c4

Please sign in to comment.