-
Notifications
You must be signed in to change notification settings - Fork 28
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
[1.5.z] Backport 23/10/2024 #1381
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
687ad34
Add propagation of maven.repo.local on windows machine
jedla97 72a71f6
Move DisabledOnRHBQWindowsConditions from testsuite to framework
jedla97 1bb7a07
Add closing resources in quarkus cli as windows is more strict
jedla97 f5d7eeb
Add @DisabledOnFipsAndNative & drop version with Java 17
michalvavrik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 7 additions & 9 deletions
16
...ons/DisabledOnFipsAndJava17Condition.java → ...ons/DisabledOnFipsAndNativeCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,29 @@ | ||
package io.quarkus.test.scenarios.annotations; | ||
|
||
import static io.quarkus.test.services.quarkus.model.QuarkusProperties.isNativeEnabled; | ||
|
||
import org.junit.jupiter.api.extension.ConditionEvaluationResult; | ||
import org.junit.jupiter.api.extension.ExecutionCondition; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
||
public class DisabledOnFipsAndJava17Condition implements ExecutionCondition { | ||
public class DisabledOnFipsAndNativeCondition implements ExecutionCondition { | ||
|
||
/** | ||
* We set environment variable "FIPS" to "fips" in our Jenkins jobs when FIPS are enabled. | ||
*/ | ||
private static final String FIPS_ENABLED = "fips"; | ||
private static final int JAVA_17 = 17; | ||
|
||
@Override | ||
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { | ||
if (isFipsEnabledEnvironment() && isJava17()) { | ||
return ConditionEvaluationResult.disabled("The test is running in FIPS enabled environment with Java 17"); | ||
if (isFipsEnabledEnvironment() && isNativeEnabled()) { | ||
return ConditionEvaluationResult.disabled("The test is running in FIPS enabled environment in native mode"); | ||
} | ||
|
||
return ConditionEvaluationResult.enabled("The test is not running in FIPS enabled environment with Java 17"); | ||
return ConditionEvaluationResult.enabled("The test is not running in FIPS enabled environment in native mode"); | ||
} | ||
|
||
private static boolean isFipsEnabledEnvironment() { | ||
return FIPS_ENABLED.equals(System.getenv().get("FIPS")); | ||
return FIPS_ENABLED.equalsIgnoreCase(System.getenv().get("FIPS")); | ||
} | ||
|
||
private static boolean isJava17() { | ||
return JAVA_17 == Runtime.version().feature(); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
.../src/main/java/io/quarkus/test/scenarios/annotations/DisabledOnRHBQWindowsConditions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.test.scenarios.annotations; | ||
|
||
import org.junit.jupiter.api.extension.ConditionEvaluationResult; | ||
import org.junit.jupiter.api.extension.ExecutionCondition; | ||
import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
||
import io.quarkus.test.services.quarkus.model.QuarkusProperties; | ||
import io.smallrye.common.os.OS; | ||
|
||
public class DisabledOnRHBQWindowsConditions implements ExecutionCondition { | ||
|
||
@Override | ||
public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext extensionContext) { | ||
boolean isWindows = OS.current().equals(OS.WINDOWS); | ||
if (QuarkusProperties.isRHBQ() && isWindows) { | ||
return ConditionEvaluationResult.disabled("It is RHBQ on Windows"); | ||
} else { | ||
return ConditionEvaluationResult.enabled("It is not RHBQ on Windows"); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...st-core/src/main/java/io/quarkus/test/scenarios/annotations/DisabledOnRHBQandWindows.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package io.quarkus.test.scenarios.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.junit.jupiter.api.extension.ExtendWith; | ||
|
||
@Inherited | ||
@Target({ ElementType.TYPE, ElementType.METHOD }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@ExtendWith(DisabledOnRHBQWindowsConditions.class) | ||
public @interface DisabledOnRHBQandWindows { | ||
|
||
/** | ||
* Why is the annotated test class or test method disabled. | ||
*/ | ||
String reason(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I might have a
MavenXpp3Reader
were I made mistake. I have to revise what I do.