Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.7.x
Browse files Browse the repository at this point in the history
Closes gh-31777
  • Loading branch information
snicoll committed Jul 18, 2022
2 parents 9c250ca + 3e3ea91 commit 92a7af4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* See {@link org.junit.jupiter.api.condition.DisabledOnOs#value()}.
* @return os
*/
OS os();
OS[] os();

/**
* Architecture of the operating system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.util.Optional;

import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.extension.ConditionEvaluationResult;
import org.junit.jupiter.api.extension.ExecutionCondition;
import org.junit.jupiter.api.extension.ExtensionContext;
Expand All @@ -42,11 +43,15 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
private ConditionEvaluationResult evaluate(DisabledOnOs annotation) {
String architecture = System.getProperty("os.arch");
String os = System.getProperty("os.name");
if (annotation.os().isCurrentOs() && annotation.architecture().equals(architecture)) {
String reason = annotation.disabledReason().isEmpty()
? String.format("Disabled on OS = %s, architecture = %s", os, architecture)
: annotation.disabledReason();
return ConditionEvaluationResult.disabled(reason);
if (annotation.architecture().equals(architecture)) {
for (OS targetOs : annotation.os()) {
if (targetOs.isCurrentOs()) {
String reason = annotation.disabledReason().isEmpty()
? String.format("Disabled on OS = %s, architecture = %s", os, architecture)
: annotation.disabledReason();
return ConditionEvaluationResult.disabled(reason);
}
}
}
return ConditionEvaluationResult
.enabled(String.format("Enabled on OS = %s, architecture = %s", os, architecture));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void whenHttp2IsNotEnabledServerConnectorHasSslAndHttpConnectionFactories() {

@Test
@SuppressWarnings("rawtypes")
@DisabledOnOs(os = OS.LINUX, architecture = "aarch64",
disabledReason = "conscrypt doesn't support Linux aarch64, see https://github.com/google/conscrypt/issues/1051")
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64",
disabledReason = "conscrypt doesn't support Linux/macOS aarch64, see https://github.com/google/conscrypt/issues/1051")
void whenHttp2IsEnabledServerConnectorsHasSslAlpnH2AndHttpConnectionFactories() {
Http2 http2 = new Http2();
http2.setEnabled(true);
Expand All @@ -71,8 +71,8 @@ void whenHttp2IsEnabledServerConnectorsHasSslAlpnH2AndHttpConnectionFactories()
}

@Test
@DisabledOnOs(os = OS.LINUX, architecture = "aarch64",
disabledReason = "conscrypt doesn't support Linux aarch64, see https://github.com/google/conscrypt/issues/1051")
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64",
disabledReason = "conscrypt doesn't support Linux/macOS aarch64, see https://github.com/google/conscrypt/issues/1051")
void alpnConnectionFactoryHasNullDefaultProtocolToAllowNegotiationToHttp11() {
Http2 http2 = new Http2();
http2.setEnabled(true);
Expand Down

0 comments on commit 92a7af4

Please sign in to comment.