Skip to content

Commit ce000c8

Browse files
committed
Merge bitcoin/bitcoin#32219: test: enabling wallet migration functional test on windows
941b8f5 ci: run get_previous_releases as part of test cross win job (Max Edwards) 5e21821 test: increment mocked time for migrating wallet backups (Max Edwards) 5174565 ci: disable feature_unsupported_utxo_db functional test (Max Edwards) 3dc90d6 test: remove mempool.dat before copying (Max Edwards) 67a6b20 test: add windows support to get previous releases script (Max Edwards) 1a1b478 scripted-diff: rename tarball to archive (Max Edwards) 4f06dc8 test: remove building from source from get prev releases script (Max Edwards) Pull request description: This PR updates the `test/get_previous_releases.py` script to also work on Windows by changing to be pure python rather than using unix tools such as `curl` and `tar`. This enables additional functional tests to run such as `wallet_migration.py`, `mempool_compatability.py` and `wallet_backwards_compatibility.py`. Unfortunately `feature_unsupported_utxo_db.py` _could_ run but this test requires Bitcoin `v0.14.3` which will not run under windows with emojis in the data directory (as the functional test runner has by default) . This test could be run as it's own step in the ci workflow file and would pass but as it's quite an old version / feature I have assumed it's not worth worrying about and best just to exclude. Two tests needed to be slightly modified to run under windows. Both were issues with trying to overwrite a file that already exists which windows seems to be more strict on than the unix based systems. Finally, building from source has been dropped from the `get_previous_releases.py` script. This had not been updated after the move to cmake and so it was assumed that nobody could have been using that feature. ACKs for top commit: maflcko: re-ACK 941b8f5 🍪 achow101: ACK 941b8f5 hodlinator: re-ACK 941b8f5 Tree-SHA512: 22933d0ec278b9b0ffcd2a8e90026e1a3631b00186e7f78bd65be925049021e319367d488c36a82ab526a07b264bac18c2777f87ca1174b231ed49fed56d11cb
2 parents f33154c + 941b8f5 commit ce000c8

File tree

7 files changed

+202
-174
lines changed

7 files changed

+202
-174
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,19 @@ jobs:
393393
- name: Run rpcauth test
394394
run: py -3 test/util/rpcauth-test.py
395395

396+
- name: Set previous release directory
397+
run: |
398+
echo "PREVIOUS_RELEASES_DIR=${{ runner.temp }}/previous_releases" >> "$GITHUB_ENV"
399+
400+
- name: Get previous releases
401+
working-directory: test
402+
run: ./get_previous_releases.py --target-dir $PREVIOUS_RELEASES_DIR
403+
396404
- name: Run functional tests
397405
env:
398406
# TODO: Fix the excluded test and re-enable it.
399-
EXCLUDE: '--exclude wallet_multiwallet.py'
407+
# feature_unsupported_utxo_db.py fails on windows because of emojis in the test data directory
408+
EXCLUDE: '--exclude wallet_multiwallet.py,feature_unsupported_utxo_db.py'
400409
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
401410
run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $EXCLUDE $TEST_RUNNER_EXTRA
402411

ci/test/03_test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if [ -z "$NO_DEPENDS" ]; then
9999
bash -c "$SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS LOG=1"
100100
fi
101101
if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
102-
test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR"
102+
test/get_previous_releases.py --target-dir "$PREVIOUS_RELEASES_DIR"
103103
fi
104104

105105
BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ build/test/functional/test_runner.py --extended
9999
In order to run backwards compatibility tests, first run:
100100

101101
```
102-
test/get_previous_releases.py -b
102+
test/get_previous_releases.py
103103
```
104104

105105
to download the necessary previous release binaries.

test/functional/mempool_compatibility.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def run_test(self):
5656
self.log.info("Move mempool.dat from old to new node")
5757
old_node_mempool = old_node.chain_path / "mempool.dat"
5858
new_node_mempool = new_node.chain_path / "mempool.dat"
59+
new_node_mempool.unlink()
5960
old_node_mempool.rename(new_node_mempool)
6061

6162
self.log.info("Start new node and verify mempool contains the tx")

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def bin_dir_from_version(version):
555555
bins_missing = True
556556
if bins_missing:
557557
raise AssertionError("At least one release binary is missing. "
558-
"Previous releases binaries can be downloaded via `test/get_previous_releases.py -b`.")
558+
"Previous releases binaries can be downloaded via `test/get_previous_releases.py`.")
559559
assert_equal(len(extra_confs), num_nodes)
560560
assert_equal(len(extra_args), num_nodes)
561561
assert_equal(len(versions), num_nodes)

test/functional/wallet_migration.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,16 @@ def test_encrypted(self):
490490

491491
# Use self.migrate_and_get_rpc to test this error to get everything copied over to the master node
492492
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.migrate_and_get_rpc, "encrypted")
493+
493494
# Use the RPC directly on the master node for the rest of these checks
495+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
494496
assert_raises_rpc_error(-4, "Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect", self.master_node.migratewallet, "encrypted", "badpass")
497+
498+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
495499
assert_raises_rpc_error(-4, "The passphrase contains a null character", self.master_node.migratewallet, "encrypted", "pass\0with\0null")
496500

497501
# Verify we can properly migrate the encrypted wallet
502+
self.master_node.bumpmocktime(1) # Prevents filename duplication on wallet backups which is a problem on Windows
498503
self.master_node.migratewallet("encrypted", passphrase="pass")
499504
wallet = self.master_node.get_wallet_rpc("encrypted")
500505

0 commit comments

Comments
 (0)