diff options
author | glozow <gloriajzhao@gmail.com> | 2024-07-22 12:07:16 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2024-07-22 12:08:32 +0100 |
commit | 3a29ff5deadc385b3be7ebecf73504fd9a2af20d (patch) | |
tree | b42f25cd4dcb8741961a5ee01357ce30e2337387 /test/functional/p2p_add_connections.py | |
parent | a1b8a917b176ee36961203ccee96457d85102e60 (diff) | |
parent | a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7 (diff) |
Merge bitcoin/bitcoin#30463: qa: Functional test improvements
a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7 qa: Do not assume running `feature_asmap.py` from source directory (Hennadii Stepanov)
9bf7ca6cad888d460f57d249264dc0062025bb3f qa: Consider `cache` and `config.ini` relative to invocation directory (Hennadii Stepanov)
a0473442d1c22043f5a288bd9255c006fd85d947 scripted-diff: Add `__file__` argument to `BitcoinTestFramework.init()` (Hennadii Stepanov)
Pull request description:
This PR includes changes split from https://github.com/bitcoin/bitcoin/pull/30454. They improve the functional test framework, allowing users to [run individual functional tests](https://github.com/hebasto/bitcoin/issues/146) from the build directory in the new CMake-based build system.
This functionality is not available for out-of-source builds using the current Autotools-based build system, which always requires write permissions for the source directory. Nevertheless, this PR can be tested as suggested in https://github.com/bitcoin/bitcoin/pull/30463#issuecomment-2232618421:
1. Make an out-of-source build:
```
$ ./autogen.sh
$ mkdir ../build && cd ../build
$ ../bitcoin/configure
$ make
```
2. Create a symlink in the build directory to a functional test:
```
$ ln --symbolic ../../../bitcoin/test/functional/wallet_disable.py ./test/functional/
```
3. Run this symlink:
```
$ ./test/functional/wallet_disable.py
```
The last command fails on the master branch:
```
Traceback (most recent call last):
File "/home/hebasto/git/build/./test/functional/wallet_disable.py", line 31, in <module>
DisableWalletTest().main()
^^^^^^^^^^^^^^^^^^^
File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 106, in __init__
self.parse_args()
File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 210, in parse_args
config.read_file(open(self.options.configfile))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/hebasto/git/bitcoin/test/config.ini'
```
and succeeds with this PR.
ACKs for top commit:
maflcko:
tested ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c 🎨
glozow:
ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7, tested with the steps in op
stickies-v:
ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7
Tree-SHA512: 899e4efc09edec13ea3f5b47825d03173fb21d3569c360deda7fa6a56b99b4d24e09ad4f0883bad1ee926b1c706e47ba07c6a6160c63c07c82b3cf4ae5816e91
Diffstat (limited to 'test/functional/p2p_add_connections.py')
-rwxr-xr-x | test/functional/p2p_add_connections.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/p2p_add_connections.py b/test/functional/p2p_add_connections.py index 0775fd873d..ee0cbdfa19 100755 --- a/test/functional/p2p_add_connections.py +++ b/test/functional/p2p_add_connections.py @@ -129,4 +129,4 @@ class P2PAddConnections(BitcoinTestFramework): if __name__ == '__main__': - P2PAddConnections().main() + P2PAddConnections(__file__).main() |