Skip to content

Commit e4aa9b1

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#22922: ci: Fix and enable tests on Windows
fa0c194 cirrus: Enable tests on windows (MarcoFalke) fadecbd test: Fix tests on Windows (MarcoFalke) Pull request description: Only a cherry-picked list. `--extended` can be enabled in a follow-up. ACKs for top commit: hebasto: ACK fa0c194, tested locally on Windows 10 Pro 20H2 (build 19042.1165): Tree-SHA512: 47cfbcef7ce5fe0c62b77a1e45ace513c4f0109b1fcfaec94faf9e488fe9430d6ba0e852230021d432847eb1389a4e4b7cf39bf17f7b09bae36af3079e0d7399
2 parents 8966499 + fa0c194 commit e4aa9b1

File tree

6 files changed

+40
-18
lines changed

6 files changed

+40
-18
lines changed

.cirrus.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
### Global defaults
2-
3-
env:
1+
env: # Global defaults
42
PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y"
53
MAKEJOBS: "-j4"
64
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
@@ -130,6 +128,7 @@ task:
130128
folder: 'C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives'
131129
install_python_script:
132130
- choco install --yes --no-progress python3 --version=3.9.6
131+
- pip install zmq
133132
- python -VV
134133
install_vcpkg_script:
135134
- cd ..
@@ -149,6 +148,8 @@ task:
149148
- src\bench_bitcoin.exe > NUL
150149
- python test\util\test_runner.py
151150
- python test\util\rpcauth-test.py
151+
functional_tests_script:
152+
- python test\functional\test_runner.py --ci --quiet --combinedlogslen=4000 --jobs=4 --timeout-factor=8 rpc_help feature_config_args rpc_signer feature_presegwit_node_upgrade "tool_wallet.py --descriptors" --failfast # TODO enable '--extended' and remove cherry-picked test list
152153

153154
task:
154155
name: 'ARM [unit tests, no functional tests] [buster]'

build_msvc/bitcoind/bitcoind.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
<Copy SourceFiles="$(ConfigIniIn)" DestinationFiles="$(ConfigIniOut)" ></Copy>
5858
<ReplaceInFile FilePath="$(ConfigIniOut)"
5959
Replace="@PACKAGE_NAME@" By="Bitcoin Core"></ReplaceInFile>
60+
<ReplaceInFile FilePath="$(ConfigIniOut)"
61+
Replace="@PACKAGE_BUGREPORT@" By="https://github.com/bitcoin/bitcoin/issues"></ReplaceInFile>
6062
<ReplaceInFile FilePath="$(ConfigIniOut)"
6163
Replace="@abs_top_srcdir@" By="..\.." ToFullPath="true"></ReplaceInFile>
6264
<ReplaceInFile FilePath="$(ConfigIniOut)"
@@ -71,12 +73,16 @@
7173
Replace="@USE_SQLITE_TRUE@" By=""></ReplaceInFile>
7274
<ReplaceInFile FilePath="$(ConfigIniOut)"
7375
Replace="@BUILD_BITCOIN_CLI_TRUE@" By=""></ReplaceInFile>
76+
<ReplaceInFile FilePath="$(ConfigIniOut)"
77+
Replace="@BUILD_BITCOIN_WALLET_TRUE@" By=""></ReplaceInFile>
7478
<ReplaceInFile FilePath="$(ConfigIniOut)"
7579
Replace="@BUILD_BITCOIND_TRUE@" By=""></ReplaceInFile>
7680
<ReplaceInFile FilePath="$(ConfigIniOut)"
7781
Replace="@ENABLE_FUZZ_TRUE@" By=""></ReplaceInFile>
7882
<ReplaceInFile FilePath="$(ConfigIniOut)"
7983
Replace="@ENABLE_ZMQ_TRUE@" By=""></ReplaceInFile>
84+
<ReplaceInFile FilePath="$(ConfigIniOut)"
85+
Replace="@ENABLE_EXTERNAL_SIGNER_TRUE@" By=""></ReplaceInFile>
8086
</Target>
8187
<Import Project="..\common.vcxproj" />
8288
</Project>

test/functional/feature_config_args.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,14 @@ def test_seed_peers(self):
164164
# fixed seeds
165165
assert not os.path.exists(os.path.join(default_data_dir, "peers.dat"))
166166
start = int(time.time())
167-
with self.nodes[0].assert_debug_log(expected_msgs=[
168-
"Loaded 0 addresses from peers.dat",
169-
"0 addresses found from DNS seeds",
170-
"opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
171-
]):
167+
with self.nodes[0].assert_debug_log(
168+
expected_msgs=[
169+
"Loaded 0 addresses from peers.dat",
170+
"0 addresses found from DNS seeds",
171+
"opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
172+
],
173+
timeout=10,
174+
):
172175
self.start_node(0, extra_args=['-dnsseed=1', '-fixedseeds=1', f'-mocktime={start}'])
173176
with self.nodes[0].assert_debug_log(expected_msgs=[
174177
"Adding fixed seeds as 60 seconds have passed and addrman is empty",
@@ -206,11 +209,14 @@ def test_seed_peers(self):
206209
# We expect the node will allow 60 seconds prior to using fixed seeds
207210
assert not os.path.exists(os.path.join(default_data_dir, "peers.dat"))
208211
start = int(time.time())
209-
with self.nodes[0].assert_debug_log(expected_msgs=[
210-
"Loaded 0 addresses from peers.dat",
211-
"DNS seeding disabled",
212-
"opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
213-
]):
212+
with self.nodes[0].assert_debug_log(
213+
expected_msgs=[
214+
"Loaded 0 addresses from peers.dat",
215+
"DNS seeding disabled",
216+
"opencon thread start", # Ensure ThreadOpenConnections::start time is properly set
217+
],
218+
timeout=10,
219+
):
214220
self.start_node(0, extra_args=['-dnsseed=0', '-fixedseeds=1', '-addnode=fakenodeaddr', f'-mocktime={start}'])
215221
with self.nodes[0].assert_debug_log(expected_msgs=[
216222
"Adding fixed seeds as 60 seconds have passed and addrman is empty",

test/functional/feature_presegwit_node_upgrade.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
assert_equal,
1010
softfork_active,
1111
)
12+
import os
13+
1214

1315
class SegwitUpgradeTest(BitcoinTestFramework):
1416
def set_test_params(self):
@@ -35,8 +37,11 @@ def run_test(self):
3537
# Restarting the node (with segwit activation height set to 5) should result in a shutdown
3638
# because the blockchain consists of 3 insufficiently validated blocks per segwit consensus rules.
3739
node.assert_start_raises_init_error(
38-
extra_args=["-segwitheight=5"],
39-
expected_msg=": Witness data for blocks after height 5 requires validation. Please restart with -reindex..\nPlease restart with -reindex or -reindex-chainstate to recover.")
40+
extra_args=["-segwitheight=5"],
41+
expected_msg=": Witness data for blocks after height 5 requires "
42+
f"validation. Please restart with -reindex..{os.linesep}"
43+
"Please restart with -reindex or -reindex-chainstate to recover.",
44+
)
4045

4146
# As directed, the user restarts the node with -reindex
4247
self.start_node(0, extra_args=["-reindex", "-segwitheight=5"])

test/functional/rpc_signer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ def run_test(self):
5353
)
5454

5555
# Handle script missing:
56-
assert_raises_rpc_error(-1, 'execve failed: No such file or directory',
57-
self.nodes[3].enumeratesigners
56+
assert_raises_rpc_error(
57+
-1,
58+
"CreateProcess failed: The system cannot find the file specified."
59+
if platform.system() == "Windows"
60+
else "execve failed: No such file or directory",
61+
self.nodes[3].enumeratesigners,
5862
)
5963

6064
# Handle error thrown by script

test/functional/tool_wallet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def test_dump_createfromdump(self):
344344
non_exist_dump = os.path.join(self.nodes[0].datadir, "wallet.nodump")
345345
self.assert_raises_tool_error('Unknown wallet file format "notaformat" provided. Please provide one of "bdb" or "sqlite".', '-wallet=todump', '-format=notaformat', '-dumpfile={}'.format(wallet_dump), 'createfromdump')
346346
self.assert_raises_tool_error('Dump file {} does not exist.'.format(non_exist_dump), '-wallet=todump', '-dumpfile={}'.format(non_exist_dump), 'createfromdump')
347-
wallet_path = os.path.join(self.nodes[0].datadir, 'regtest/wallets/todump2')
347+
wallet_path = os.path.join(self.nodes[0].datadir, 'regtest', 'wallets', 'todump2')
348348
self.assert_raises_tool_error('Failed to create database path \'{}\'. Database already exists.'.format(wallet_path), '-wallet=todump2', '-dumpfile={}'.format(wallet_dump), 'createfromdump')
349349
self.assert_raises_tool_error("The -descriptors option can only be used with the 'create' command.", '-descriptors', '-wallet=todump2', '-dumpfile={}'.format(wallet_dump), 'createfromdump')
350350

0 commit comments

Comments
 (0)