hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

[suggestion] Support `release` profile in `test_env.py` #4176

Open 0x009922 opened 10 months ago

0x009922 commented 10 months ago

Description

test_env.py builds and uses several binaries in debug mode (kagami, iroha, iroha_client_cli). In some cases I find it more practical to setup a testing environment using release binaries. When I do not change binaries themselves, but want to run tests again and again, tests running with release Iroha build might complete much faster, although I haven't checked.

So, my request is to extend test_env.py CLI with an argument to specify using binaries with release profile:

./test_env.py setup --release
# or
./test_env.py setup --profile=release
Bobidada1 commented 10 months ago

import argparse

def setup_environment(profile):

Logic to set up the environment using specified profile

if profile == 'release':
    # Use release binaries
    print("Setting up the environment with release binaries...")
    # Your code to use release binaries goes here
else:
    # Use debug binaries by default
    print("Setting up the environment with debug binaries...")
    # Your code to use debug binaries goes here

if name == "main": parser = argparse.ArgumentParser(description='Setup environment for testing') parser.add_argument('--profile', choices=['debug', 'release'], default='debug', help='Specify the profile for binaries (default: debug)')

args = parser.parse_args()

setup_environment(args.profile)