Skip to content

Commit

Permalink
fix: add noninteractive
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Mar 19, 2024
1 parent 220eb51 commit c4a6e5a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get_env_or_default(env_name: str, default: Any, validation: Any = None) -> A
USE_BINARY_EXECUTABLE = "DAN_TESTING_USE_BINARY_EXECUTABLE" in os.environ
STEPS_CREATE_ACCOUNT = is_boolstring_true(get_env_or_default("DAN_TESTING_STEPS_CREATE_ACCOUNT", "true", is_boolstring))
STEPS_CREATE_TEMPLATE = is_boolstring_true(get_env_or_default("DAN_TESTING_STEPS_CREATE_TEMPLATE", "false", is_boolstring))
NONINTERACTIVE = is_boolstring_true(get_env_or_default("DAN_TESTING_NONINTERACTIVE", "false", is_boolstring))
STEPS_RUN_TARI_CONNECTOR_TEST_SITE = is_boolstring_true(get_env_or_default("DAN_TESTING_STEPS_RUN_TARI_CONNECTOR_TEST_SITE", "true", is_boolstring))
STEPS_RUN_SIGNALLING_SERVER = True
LISTEN_ONLY_ON_LOCALHOST = True
Expand Down
1 change: 1 addition & 0 deletions docker_rig/dan-testing.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ ENV DAN_TESTING_WEBUI_PORT=${DAN_TESTING_WEBUI_PORT:-18000}
ENV DAN_TESTING_STEPS_CREATE_ACCOUNT=True
ENV DAN_TESTING_STEPS_RUN_TARI_CONNECTOR_TEST_SITE=True
ENV DAN_TESTING_USE_BINARY_EXECUTABLE=True
ENV DAN_TESTING_NONINTERACTIVE=True
ENV DAN_TESTING_DATA_FOLDER=/home/tari/data
ENV TARI_BINS_FOLDER=/usr/local/bin/
ENV TARI_DAN_BINS_FOLDER=/usr/local/bin/
Expand Down
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pyright: reportUnboundVariable=false

from Common.config import (
NONINTERACTIVE,
TARI_BINS_FOLDER,
TARI_DAN_BINS_FOLDER,
BURN_AMOUNT,
Expand Down Expand Up @@ -480,7 +481,12 @@ def create_account(i: int, amount: int):
if STRESS_TEST:
stress_test()
print(stats)
cli_loop()
if not NONINTERACTIVE:
cli_loop()
else:
print("Non-interactive mode")
while True:
time.sleep(10)
except Exception as ex:
print("Failed setup:", ex)
traceback.print_exc()
Expand Down

0 comments on commit c4a6e5a

Please sign in to comment.