TestTools contains module which handles paths to executables using by TestTools (like hived, cli_wallet, and so on...). You can configure which executables should be used in following ways:
- set directly in script
- passed as command line arguments
- environment variables
- executable installation
If you have paths configured in multiple ways (i.e. you have installed hived and also passed its path as command line argument), they will be used with its priorities. Priorities are same as in list above; path set directly in script is the most important, less important is path passed as command line argument and so on. So in example mentioned earlier, installed hived will be ignored and hived path passed as command line argument will be used.
You can set path to executable directly in your script like on example below:
import test_tools as tt
tt.paths_to_executables.set_path_of('hived', '/home/dev/hive/programs/hived/hived')
To pass path as command line argument you have to run your script with one of following parameters:
Executable | Argument name |
---|---|
All executables | --build-root-path |
hived | --hived-path |
cli_wallet | --cli-wallet-path |
get_dev_key | --get-dev-key-path |
compress_block_log | --compress-block-log-path |
block_log_util | --block-log-util-path |
Example run with all executables from selected path:
python3 my_script.py --build-root-path="/home/dev/hive/build"
Example run with custom hived path:
python3 my_script.py --hived-path="/home/dev/hive/build/programs/hived/hived"
To define path using environment variables you have to use following variable names:
Executable | Variable name |
---|---|
All executables | HIVE_BUILD_ROOT_PATH |
hived | HIVED_PATH |
cli_wallet | CLI_WALLET_PATH |
get_dev_key | GET_DEV_KEY_PATH |
compress_block_log | COMPRESS_BLOCK_LOG_PATH |
block_log_util | BLOCK_LOG_UTIL_PATH |
libfaketime | LIBFAKETIME_PATH |
Example run with all executables from selected path:
HIVE_BUILD_ROOT_PATH="/home/dev/hive/build/" python3 my_script.py
Example run with custom hived path:
HIVED_PATH="/home/dev/hive/build/programs/hived/hived" python3 my_script.py
Installed executables will be automatically detected.