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

[DO NOT MERGE] Test enable win CLI test #2244

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,27 @@ jobs:
java-version: ${{ matrix.java }}
check-latest: true
cache: 'maven'
- name: Set up Maven settings.xml
run: Copy-Item -Path ".github/quarkus-snapshots-mvn-settings.xml" -Destination "$env:USERPROFILE/.m2/settings.xml"
- name: Download Quarkus CLI
shell: bash
run: mvn -B --no-transfer-progress org.apache.maven.plugins:maven-dependency-plugin:get -Dartifact=io.quarkus:quarkus-cli:999-SNAPSHOT:jar:runner
- name: Install Quarkus CLI
run: |
$quarkusCliFileContent = @"
@ECHO OFF
java -jar %HOMEDRIVE%%HOMEPATH%\.m2\repository\io\quarkus\quarkus-cli\999-SNAPSHOT\quarkus-cli-999-SNAPSHOT-runner.jar %*
"@
New-Item -Path "$(pwd)\quarkus-dev-cli.bat" -ItemType File
Set-Content -Path "$(pwd)\quarkus-dev-cli.bat" -Value $quarkusCliFileContent
./quarkus-dev-cli.bat version
- name: Build in JVM mode
shell: bash
run: |
mvn -B --no-transfer-progress -fae -s .github/quarkus-snapshots-mvn-settings.xml clean verify ${{ matrix.module-mvn-args }} -am
# Need to set UTF-8 as otherwise the cp1252 is used on GH windows runner
# TODO revisit this with Windows 2025 when available or when we move testing to JDK 21+ only
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
mvn -B --no-transfer-progress -fae -s .github/quarkus-snapshots-mvn-settings.xml clean verify ${{ matrix.module-mvn-args }} -am -D"include.quarkus-cli-tests" -D"ts.quarkus.cli.cmd=$(pwd)\quarkus-dev-cli.bat" -D"gh-action-disable-on-win"
- name: Detect flaky tests
id: flaky-test-detector
if: ${{ hashFiles('**/flaky-run-report.json') != '' }}
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,27 @@ jobs:
distribution: 'temurin'
java-version: ${{ matrix.java }}
check-latest: true
- name: Set up Maven settings.xml
run: Copy-Item -Path ".github/quarkus-snapshots-mvn-settings.xml" -Destination "$env:USERPROFILE/.m2/settings.xml"
- name: Download Quarkus CLI
shell: bash
run: mvn -B --no-transfer-progress org.apache.maven.plugins:maven-dependency-plugin:get -Dartifact=io.quarkus:quarkus-cli:999-SNAPSHOT:jar:runner
- name: Install Quarkus CLI
run: |
$quarkusCliFileContent = @"
@ECHO OFF
java -jar %HOMEDRIVE%%HOMEPATH%\.m2\repository\io\quarkus\quarkus-cli\999-SNAPSHOT\quarkus-cli-999-SNAPSHOT-runner.jar %*
"@
New-Item -Path "$(pwd)\quarkus-dev-cli.bat" -ItemType File
Set-Content -Path "$(pwd)\quarkus-dev-cli.bat" -Value $quarkusCliFileContent
./quarkus-dev-cli.bat version
- name: Build in JVM mode
shell: bash
run: |
mvn -B --no-transfer-progress -fae -s .github/quarkus-snapshots-mvn-settings.xml clean verify
# Need to set UTF-8 as otherwise the cp1252 is used on GH windows runner
# TODO revisit this with Windows 2025 when available or when we move testing to JDK 21+ only
export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
mvn -B --no-transfer-progress -fae -s .github/quarkus-snapshots-mvn-settings.xml clean verify -D"include.quarkus-cli-tests" -D"ts.quarkus.cli.cmd=$(pwd)\quarkus-dev-cli.bat" -D"gh-action-disable-on-win"
- name: Zip Artifacts
shell: bash
if: failure()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.bootstrap.config.QuarkusConfigCommand;
import io.quarkus.test.bootstrap.config.QuarkusSetConfigCommandBuilder.EncryptOption;
Expand All @@ -24,6 +25,7 @@
import io.quarkus.ts.quarkus.cli.config.surefire.SetPropertyTest;

@DisabledOnQuarkusVersion(version = "3\\.(9|10|11|12)\\..*", reason = "https://github.com/quarkusio/quarkus/pull/41203 merged in 3.13")
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "Some windows don't have all language pack/locales so it causing it fail")
@TestMethodOrder(MethodOrderer.OrderAnnotation.class) // remember, this is stateful test as well as stateful cmd builder
@Tag("QUARKUS-3456")
@Tag("quarkus-cli")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.api.condition.OS;
Expand Down Expand Up @@ -46,16 +47,19 @@ public void shouldCreateApplicationOnJvmWithSpecialChars() {
}

@Test
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "Some windows don't have all language pack/locales so it causing it fail")
public void shouldCreateApplicationOnJvmWithDiacritics() {
assertCreateJavaApplicationAtFolder(FOLDER_WITH_DIACRITICS);
}

@Test
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "Some windows don't have all language pack/locales so it causing it fail")
public void shouldCreateApplicationOnJvmWithJapanese() {
assertCreateJavaApplicationAtFolder(FOLDER_WITH_JAPANESE);
}

@Test
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "Some windows don't have all language pack/locales so it causing it fail")
public void shouldCreateApplicationOnJvmWithInternationalization() {
assertCreateJavaApplicationAtFolder(FOLDER_WITH_INTERNATIONALIZATION);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
package io.quarkus.ts.quarkus.cli;

import static io.quarkus.test.scenarios.annotations.DisabledOnQuarkusSnapshotCondition.isQuarkusSnapshotVersion;
import static org.junit.jupiter.api.Assertions.assertEquals;

import jakarta.inject.Inject;

import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIf;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.builder.Version;
import io.quarkus.test.bootstrap.QuarkusCliClient;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnNative;
import io.quarkus.test.scenarios.annotations.DisabledOnQuarkusVersion;

@DisabledIf(value = "isQuarkusSnapshotRunOnWindows", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1464")
@Tag("QUARKUS-960")
@Tag("quarkus-cli")
@QuarkusScenario
@DisabledOnQuarkusVersion(version = ".*redhat.*", reason = "Do not run CLI version check on productized bits")
@DisabledOnNative // Only for JVM verification
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "We setting `-Dfile.encoding=UTF8` on GH windows action. This causing the output the `picked up java_tool_options` which is not expected in this test.") // TODO remove when We test with JDK 21+
public class QuarkusCliVersionIT {

@Inject
Expand All @@ -35,8 +33,4 @@ public void shouldVersionMatchQuarkusVersion() {
// Using shortcut
assertEquals(Version.getVersion(), cliClient.run("-v").getOutput());
}

static boolean isQuarkusSnapshotRunOnWindows() {
return isQuarkusSnapshotVersion() && OS.current() == OS.WINDOWS;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.inject.Inject;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.junit.QuarkusTest;
import io.smallrye.config.SmallRyeConfig;
Expand All @@ -18,6 +19,7 @@
* This test is only support to run inside QuarkusCliConfigSetIT.
*/
@QuarkusTest
@DisabledIfSystemProperty(named = "gh-action-disable-on-win", matches = "true", disabledReason = "Some windows don't have all language pack/locales so it causing it fail")
public class SetPropertyTest {

@Inject
Expand Down
Loading