Skip to content

Commit

Permalink
qa: Consider cache and config.ini relative to invocation directory
Browse files Browse the repository at this point in the history
In CMake-based build system (1) `config.ini` is created in the build
directory, and (2) `cache` must also be created in the same directory.

This change enables running individual functional tests from the build
directory.
  • Loading branch information
hebasto committed Jun 9, 2024
1 parent ca1f7b8 commit 1ec9926
Show file tree
Hide file tree
Showing 246 changed files with 250 additions and 250 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fuzz)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/util)

file(GLOB_RECURSE functional_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} functional/*.py)
file(GLOB_RECURSE functional_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} functional/*)
foreach(script ${functional_tests} fuzz/test_runner.py util/rpcauth-test.py util/test_runner.py)
if(CMAKE_HOST_WIN32)
set(symlink)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/create_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def run_test(self):
pass

if __name__ == '__main__':
CreateCache().main()
CreateCache(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,4 @@ def run_test(self):


if __name__ == '__main__':
ExampleTest().main()
ExampleTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_abortnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ def run_test(self):


if __name__ == '__main__':
AbortNodeTest().main()
AbortNodeTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_addrman.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,4 @@ def run_test(self):


if __name__ == "__main__":
AddrmanTest().main()
AddrmanTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_anchors.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ def run_test(self):


if __name__ == "__main__":
AnchorsTest().main()
AnchorsTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_asmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ def run_test(self):


if __name__ == '__main__':
AsmapTest().main()
AsmapTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_assumeutxo.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,4 +490,4 @@ class Block:
chain_tx: int

if __name__ == '__main__':
AssumeutxoTest().main()
AssumeutxoTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_assumevalid.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ def run_test(self):


if __name__ == '__main__':
AssumeValidTest().main()
AssumeValidTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_bind_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ def run_test(self):
self.log.info(f"Stopped node {i}")

if __name__ == '__main__':
BindExtraTest().main()
BindExtraTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_bind_port_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def run_test(self):
assert found_addr1

if __name__ == '__main__':
BindPortDiscoverTest().main()
BindPortDiscoverTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_bind_port_externalip.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def run_test(self):
assert found

if __name__ == '__main__':
BindPortExternalIPTest().main()
BindPortExternalIPTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,4 +412,4 @@ def test_version2_relay(self):


if __name__ == '__main__':
BIP68Test().main()
BIP68Test(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -1435,4 +1435,4 @@ def send_blocks(self, blocks, success=True, reject_reason=None, force_send=False


if __name__ == '__main__':
FullBlockTest().main()
FullBlockTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_blocksdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def run_test(self):


if __name__ == '__main__':
BlocksdirTest().main()
BlocksdirTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_cltv.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,4 @@ def run_test(self):


if __name__ == '__main__':
BIP65Test().main()
BIP65Test(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_coinstatsindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ def _test_init_index_after_reorg(self):


if __name__ == '__main__':
CoinStatsIndexTest().main()
CoinStatsIndexTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,4 @@ def run_test(self):


if __name__ == '__main__':
ConfArgsTest().main()
ConfArgsTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_csv_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,4 @@ def run_test(self):


if __name__ == '__main__':
BIP68_112_113Test().main()
BIP68_112_113Test(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_dbcrash.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,4 @@ def run_test(self):


if __name__ == "__main__":
ChainstateWriteCrashTest().main()
ChainstateWriteCrashTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_dersig.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ def run_test(self):


if __name__ == '__main__':
BIP66Test().main()
BIP66Test(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_dirsymlinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def run_test(self):


if __name__ == "__main__":
SymlinkTest().main()
SymlinkTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def run_test(self):


if __name__ == '__main__':
DiscoverTest().main()
DiscoverTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_fastprune.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ def run_test(self):


if __name__ == '__main__':
FeatureFastpruneTest().main()
FeatureFastpruneTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_fee_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,4 @@ def run_test(self):


if __name__ == "__main__":
EstimateFeeTest().main()
EstimateFeeTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def check_wallet_filelock(descriptors):
check_wallet_filelock(True)

if __name__ == '__main__':
FilelockTest().main()
FilelockTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ def run_test(self):


if __name__ == '__main__':
HelpTest().main()
HelpTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_includeconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ def run_test(self):
assert subversion.endswith("main; relative; relative2)/")

if __name__ == '__main__':
IncludeConfTest().main()
IncludeConfTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_index_prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ def run_test(self):


if __name__ == '__main__':
FeatureIndexPruneTest().main()
FeatureIndexPruneTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ def check_clean_start():


if __name__ == '__main__':
InitStressTest().main()
InitStressTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_loadblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ def run_test(self):


if __name__ == '__main__':
LoadblockTest().main()
LoadblockTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ def run_test(self):


if __name__ == '__main__':
LoggingTest().main()
LoggingTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_maxtipage.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ def run_test(self):


if __name__ == '__main__':
MaxTipAgeTest().main()
MaxTipAgeTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_maxuploadtarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ def run_test(self):
self.nodes[0].assert_start_raises_init_error(extra_args=["-maxuploadtarget=abc"], expected_msg="Error: Unable to parse -maxuploadtarget: 'abc'")

if __name__ == '__main__':
MaxUploadTest().main()
MaxUploadTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_minchainwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ def run_test(self):


if __name__ == '__main__':
MinimumChainWorkTest().main()
MinimumChainWorkTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@ def expect_wallet_notify(self, tx_details):


if __name__ == '__main__':
NotificationsTest().main()
NotificationsTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_nulldummy.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ def block_submit(self, node, txs, *, with_witness=False, accept):


if __name__ == '__main__':
NULLDUMMYTest().main()
NULLDUMMYTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_posix_fs_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def run_test(self):


if __name__ == '__main__':
PosixFsPermissionsTest().main()
PosixFsPermissionsTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_presegwit_node_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def run_test(self):


if __name__ == '__main__':
SegwitUpgradeTest().main()
SegwitUpgradeTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,4 +457,4 @@ def networks_dict(d):
os.unlink(socket_path)

if __name__ == '__main__':
ProxyTest().main()
ProxyTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_pruning.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,4 +495,4 @@ def test_scanblocks_pruned(self):
"start", [{"desc": f"raw({false_positive_spk.hex()})"}], 0, 0, "basic", {"filter_false_positives": True})

if __name__ == '__main__':
PruneTest().main()
PruneTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,4 +727,4 @@ def test_fullrbf(self):
assert conflicting_tx['txid'] in self.nodes[0].getrawmempool()

if __name__ == '__main__':
ReplaceByFeeTest().main()
ReplaceByFeeTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ def run_test(self):


if __name__ == '__main__':
ReindexTest().main()
ReindexTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_reindex_readonly.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def run_test(self):


if __name__ == '__main__':
BlockstoreReindexTest().main()
BlockstoreReindexTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_remove_pruned_files_on_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def run_test(self):
assert not os.path.exists(rev1)

if __name__ == '__main__':
FeatureRemovePrunedFilesOnStartupTest().main()
FeatureRemovePrunedFilesOnStartupTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_segwit.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,4 +657,4 @@ def create_and_mine_tx_from_txids(self, txids, success=True):


if __name__ == '__main__':
SegWitTest().main()
SegWitTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ def run_test(self):


if __name__ == '__main__':
SettingsTest().main()
SettingsTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def run_test(self):
self.stop_node(0, wait=1000)

if __name__ == '__main__':
ShutdownTest().main()
ShutdownTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_signet.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ def run_test(self):


if __name__ == '__main__':
SignetBasicTest().main()
SignetBasicTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_startupnotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def get_count():


if __name__ == '__main__':
StartupNotifyTest().main()
StartupNotifyTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_taproot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1766,4 +1766,4 @@ def run_test(self):


if __name__ == '__main__':
TaprootTest().main()
TaprootTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_uacomment.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def run_test(self):


if __name__ == '__main__':
UacommentTest().main()
UacommentTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_unsupported_utxo_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def run_test(self):


if __name__ == "__main__":
UnsupportedUtxoDbTest().main()
UnsupportedUtxoDbTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_utxo_set_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def run_test(self):


if __name__ == '__main__':
UTXOSetHashTest().main()
UTXOSetHashTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/feature_versionbits_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,4 @@ def run_test(self):
self.wait_until(lambda: self.versionbits_in_alert_file())

if __name__ == '__main__':
VersionBitsWarningTest().main()
VersionBitsWarningTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_bitcoin_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,4 @@ def run_test(self):


if __name__ == '__main__':
TestBitcoinCli().main()
TestBitcoinCli(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ def run_test(self):


if __name__ == '__main__':
HTTPBasicsTest ().main ()
HTTPBasicsTest(__file__).main ()
2 changes: 1 addition & 1 deletion test/functional/interface_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,4 @@ def run_test(self):
assert_equal(resp.read().decode('utf-8').rstrip(), f"Invalid hash: {INVALID_PARAM}")

if __name__ == '__main__':
RESTTest().main()
RESTTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,4 @@ def run_test(self):


if __name__ == '__main__':
RPCInterfaceTest().main()
RPCInterfaceTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_usdt_coinselection.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@ def run_test(self):


if __name__ == '__main__':
CoinSelectionTracepointTest().main()
CoinSelectionTracepointTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_usdt_mempool.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,4 @@ def run_test(self):


if __name__ == "__main__":
MempoolTracepointTest().main()
MempoolTracepointTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_usdt_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ def handle_outbound(_, data, __):


if __name__ == '__main__':
NetTracepointTest().main()
NetTracepointTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_usdt_utxocache.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,4 @@ def handle_utxocache_flush(_, data, __):


if __name__ == '__main__':
UTXOCacheTracepointTest().main()
UTXOCacheTracepointTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_usdt_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ def handle_blockconnected(_, data, __):


if __name__ == '__main__':
ValidationTracepointTest().main()
ValidationTracepointTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/interface_zmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,4 +597,4 @@ def test_ipv6(self):


if __name__ == '__main__':
ZMQTest().main()
ZMQTest(__file__).main()
2 changes: 1 addition & 1 deletion test/functional/mempool_accept.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,4 +408,4 @@ def run_test(self):
)

if __name__ == '__main__':
MempoolAcceptanceTest().main()
MempoolAcceptanceTest(__file__).main()
Loading

0 comments on commit 1ec9926

Please sign in to comment.