[UPD] test: help in red to read log when got error
This commit is contained in:
parent
5535a81213
commit
06bb6a0cc7
1 changed files with 12 additions and 2 deletions
|
|
@ -117,6 +117,7 @@ def extract_result(result, test_name, lst_error, lst_warning):
|
||||||
|
|
||||||
|
|
||||||
def check_result(task_list, tpl_result):
|
def check_result(task_list, tpl_result):
|
||||||
|
status = True
|
||||||
lst_error = []
|
lst_error = []
|
||||||
lst_warning = []
|
lst_warning = []
|
||||||
|
|
||||||
|
|
@ -125,6 +126,9 @@ def check_result(task_list, tpl_result):
|
||||||
result, task_list[i].cr_code.co_name, lst_error, lst_warning
|
result, task_list[i].cr_code.co_name, lst_error, lst_warning
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if lst_error:
|
||||||
|
status = False
|
||||||
|
|
||||||
if lst_warning:
|
if lst_warning:
|
||||||
print(f"{Fore.YELLOW}{len(lst_warning)} WARNING{Fore.RESET}")
|
print(f"{Fore.YELLOW}{len(lst_warning)} WARNING{Fore.RESET}")
|
||||||
i = 0
|
i = 0
|
||||||
|
|
@ -148,6 +152,7 @@ def check_result(task_list, tpl_result):
|
||||||
str_result = f"{Fore.GREEN}SUCCESS 🍰"
|
str_result = f"{Fore.GREEN}SUCCESS 🍰"
|
||||||
|
|
||||||
print(f"{Fore.BLUE}Summary TEST {str_result}{Fore.RESET}")
|
print(f"{Fore.BLUE}Summary TEST {str_result}{Fore.RESET}")
|
||||||
|
return status
|
||||||
|
|
||||||
|
|
||||||
def print_log(lst_task, tpl_result):
|
def print_log(lst_task, tpl_result):
|
||||||
|
|
@ -165,7 +170,6 @@ def print_log(lst_task, tpl_result):
|
||||||
if result[0]:
|
if result[0]:
|
||||||
f.write(result[0])
|
f.write(result[0])
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
print(f"Log file {LOG_FILE}")
|
|
||||||
|
|
||||||
|
|
||||||
async def run_command_get_output(*args, cwd=None):
|
async def run_command_get_output(*args, cwd=None):
|
||||||
|
|
@ -1290,7 +1294,13 @@ def run_all_test(config) -> None:
|
||||||
finally:
|
finally:
|
||||||
loop.close()
|
loop.close()
|
||||||
print_log(task_list, tpl_result)
|
print_log(task_list, tpl_result)
|
||||||
check_result(task_list, tpl_result)
|
status = check_result(task_list, tpl_result)
|
||||||
|
if status:
|
||||||
|
log_file_print = LOG_FILE
|
||||||
|
else:
|
||||||
|
log_file_print = f"{Fore.RED}{LOG_FILE}{Fore.RESET}"
|
||||||
|
|
||||||
|
print(f"Log file {log_file_print}")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue