From 2c26259348323abb144413395f46a56e586a7e9f Mon Sep 17 00:00:00 2001 From: Daniel Lehrner Date: Thu, 14 Jul 2022 18:16:14 +0200 Subject: [PATCH] Ignore 2 tests that assume that the system language is English, if that should not be the case (#4102) * ignore 2 tests that assume that the system language is English, if that should not be the case Signed-off-by: Daniel Lehrner --- CHANGELOG.md | 1 + .../test/java/org/hyperledger/besu/cli/BesuCommandTest.java | 6 ++++++ .../p2p/network/NetworkingServiceLifecycleTest.java | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ee924444..79347904c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Add a PoS block header rule to check that the current block is more recent than its parent [#4066](https://github.com/hyperledger/besu/pull/4066) - Fixed a trie log layer issue on bonsai during reorg [#4069](https://github.com/hyperledger/besu/pull/4069) - Fix transition protocol schedule to return the pre Merge schedule when reorg pre TTD [#4078](https://github.com/hyperledger/besu/pull/4078) +- The build process runs successfully even though the system language is not English [#4102](https://github.com/hyperledger/besu/pull/4102) ## 22.7.0-RC1 diff --git a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java index e1cbe33e50..eedb1c3a56 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/BesuCommandTest.java @@ -17,6 +17,7 @@ package org.hyperledger.besu.cli; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; +import static org.hamcrest.Matchers.startsWith; import static org.hyperledger.besu.cli.config.NetworkName.CLASSIC; import static org.hyperledger.besu.cli.config.NetworkName.DEV; import static org.hyperledger.besu.cli.config.NetworkName.GOERLI; @@ -41,6 +42,7 @@ import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfigura import static org.hyperledger.besu.ethereum.p2p.config.DefaultDiscoveryConfiguration.RINKEBY_DISCOVERY_URL; import static org.hyperledger.besu.ethereum.worldstate.DataStorageFormat.BONSAI; import static org.hyperledger.besu.nat.kubernetes.KubernetesNatManager.DEFAULT_BESU_SERVICE_NAME_FILTER; +import static org.junit.Assume.assumeThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isNotNull; @@ -4755,6 +4757,10 @@ public class BesuCommandTest extends CommandTestAbstract { @Test public void privEnclaveKeyFileDoesNotExist() { + assumeThat( + "Ignored if system language is not English", + System.getProperty("user.language"), + startsWith("en")); parseCommand("--privacy-enabled=true", "--privacy-public-key-file", "/non/existent/file"); assertThat(commandOutput.toString(UTF_8)).isEmpty(); diff --git a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/NetworkingServiceLifecycleTest.java b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/NetworkingServiceLifecycleTest.java index 715eb43143..96340b7705 100644 --- a/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/NetworkingServiceLifecycleTest.java +++ b/ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/network/NetworkingServiceLifecycleTest.java @@ -17,7 +17,9 @@ package org.hyperledger.besu.ethereum.p2p.network; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.hamcrest.Matchers.startsWith; import static org.hyperledger.besu.ethereum.p2p.NetworkingTestHelper.configWithRandomPorts; +import static org.junit.Assume.assumeThat; import org.hyperledger.besu.crypto.NodeKey; import org.hyperledger.besu.crypto.NodeKeyUtils; @@ -139,6 +141,10 @@ public class NetworkingServiceLifecycleTest { @Test public void startDiscoveryPortInUse() throws IOException { + assumeThat( + "Ignored if system language is not English", + System.getProperty("user.language"), + startsWith("en")); try (final P2PNetwork service1 = builder().config(config).build()) { service1.start(); final NetworkingConfiguration config = configWithRandomPorts();