[FIX] script test parallel: check file exist before crash
This commit is contained in:
parent
ea9be9b2ca
commit
b38d67e35a
2 changed files with 15 additions and 1 deletions
|
|
@ -81,7 +81,9 @@ def main():
|
||||||
)
|
)
|
||||||
return -1
|
return -1
|
||||||
elif lst_result_good:
|
elif lst_result_good:
|
||||||
_logger.info(f"{Fore.GREEN}SUCCESS{Style.RESET_ALL} - All modules are updated.")
|
_logger.info(
|
||||||
|
f"{Fore.GREEN}SUCCESS{Style.RESET_ALL} - All modules are updated."
|
||||||
|
)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -486,6 +486,12 @@ async def test_exec(
|
||||||
s_first_path = destination_path
|
s_first_path = destination_path
|
||||||
|
|
||||||
hook_file = os.path.join(new_s_first_path, "hooks.py")
|
hook_file = os.path.join(new_s_first_path, "hooks.py")
|
||||||
|
if not os.path.exists(hook_file):
|
||||||
|
test_status += 1
|
||||||
|
test_result += f"Hook file '{hook_file}' not exist."
|
||||||
|
delta = datetime.datetime.now() - time_init
|
||||||
|
total_time = delta.total_seconds()
|
||||||
|
return test_result, test_status, test_name, total_time
|
||||||
with open(hook_file) as hook:
|
with open(hook_file) as hook:
|
||||||
hook_line = hook.read()
|
hook_line = hook.read()
|
||||||
has_template = (
|
has_template = (
|
||||||
|
|
@ -576,6 +582,12 @@ async def test_exec(
|
||||||
lst_path_to_remove_config=lst_path_to_remove_config,
|
lst_path_to_remove_config=lst_path_to_remove_config,
|
||||||
module_name=generated_module,
|
module_name=generated_module,
|
||||||
)
|
)
|
||||||
|
if not os.path.exists(new_config_path):
|
||||||
|
test_status += 1
|
||||||
|
test_result += f"Config file '{new_config_path}' not exist."
|
||||||
|
delta = datetime.datetime.now() - time_init
|
||||||
|
total_time = delta.total_seconds()
|
||||||
|
return test_result, test_status, test_name, total_time
|
||||||
else:
|
else:
|
||||||
new_config_path = None
|
new_config_path = None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue