Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
feat(reg): Independent flag for statistical tests
Browse files Browse the repository at this point in the history
The 3rd arguement is the option to chose if turn on
debugging mode of the statisical tests.
  • Loading branch information
howjmay committed May 22, 2019
1 parent 3d18d05 commit 8b1c13f
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions tests/regression/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
raw_url = sys.argv[1]
elif len(sys.argv) == 3:
raw_url = sys.argv[1]
# if DEBUG_FLAG field == `Y`, then starts debugging mode with less iteration in statistical tests
if sys.argv[2] == 'y' or sys.argv[2] == 'Y':
if sys.argv[2] == 'Y':
DEBUG_FLAG = True
else:
raw_url = "localhost:8000"
Expand All @@ -34,7 +33,8 @@
LEN_MSG_SIGN = 2187
tryte_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ9"

if sys.argv[2] == 'Y':
# the 3rd arg is the option which determine if use the debugging mode of statistical tests
if sys.argv[3] == 'Y':
TIMES_TOTAL = 2
else:
TIMES_TOTAL = 100
Expand Down Expand Up @@ -138,11 +138,9 @@ def test_mam_send_msg(self):
post_data_json = json.dumps(post_data)
response.append(API("/mam/", post_data=post_data_json))

if DEBUG_FLAG == True:
for i in range(len(response)):
logging.debug("send msg i = " + str(i) + ", res = " +
response[i][0] + ", status code = " +
response[i][1])
for i in range(len(response)):
logging.debug("send msg i = " + str(i) + ", res = " +
response[i][0] + ", status code = " + response[i][1])

for i in range(len(response)):
logging.debug("send msg i = " + str(i) + ", res = " +
Expand Down Expand Up @@ -260,11 +258,9 @@ def test_send_transfer(self):
post_data_json = json.dumps(post_data)
response.append(API("/transaction/", post_data=post_data_json))

if DEBUG_FLAG == True:
for i in range(len(response)):
logging.debug("send transfer i = " + str(i) + ", res = " +
response[i][0] + ", status code = " +
response[i][1])
for i in range(len(response)):
logging.debug("send transfer i = " + str(i) + ", res = " +
response[i][0] + ", status code = " + response[i][1])

pass_case = [0, 1, 2, 3]
for i in range(len(response)):
Expand Down Expand Up @@ -340,11 +336,11 @@ def test_find_transactions_by_tag(self):
post_data_json = json.dumps(post_data)
transaction_response.append(
API("/transaction/", post_data=post_data_json))
if DEBUG_FLAG == True:
for i in range(len(transaction_response)):
logging.debug("find transactions by tag i = " + str(i) +
", tx_res = " + transaction_response[i][0] +
", status code = " + transaction_response[i][1])

for i in range(len(transaction_response)):
logging.debug("find transactions by tag i = " + str(i) +
", tx_res = " + transaction_response[i][0] +
", status code = " + transaction_response[i][1])

response = []
for t_case in test_cases:
Expand All @@ -354,11 +350,10 @@ def test_find_transactions_by_tag(self):
else:
response.append(API("/tag/", get_data="/hashes"))

if DEBUG_FLAG == True:
for i in range(len(response)):
logging.debug("find transactions by tag i = " + str(i) +
", res = " + response[i][0] +
", status code = " + response[i][1])
for i in range(len(response)):
logging.debug("find transactions by tag i = " + str(i) +
", res = " + response[i][0] + ", status code = " +
response[i][1])

for i in range(len(response)):
logging.debug("find transactions by tag i = " + str(i) +
Expand Down

0 comments on commit 8b1c13f

Please sign in to comment.