Skip to content
Snippets Groups Projects
Commit bb6a3966 authored by Raphael Defosseux's avatar Raphael Defosseux
Browse files

chore(ci): tutorial HTML reports will show how long shutdown procedures took

parent e3ec5ad6
No related branches found
No related tags found
1 merge request!175chore(ci): checking how CN5G containers stop
...@@ -99,7 +99,7 @@ class HtmlReport(): ...@@ -99,7 +99,7 @@ class HtmlReport():
log_files = sorted(os.listdir(cwd + '/archives/' + tutorial)) log_files = sorted(os.listdir(cwd + '/archives/' + tutorial))
deployedContainerImages = [] deployedContainerImages = []
noByeMessageContainers = [] byeMessages = []
for log_file in log_files: for log_file in log_files:
if not log_file.endswith(".log"): if not log_file.endswith(".log"):
continue continue
...@@ -144,12 +144,13 @@ class HtmlReport(): ...@@ -144,12 +144,13 @@ class HtmlReport():
byeMessagePresent = False byeMessagePresent = False
with open(cwd + f'/archives/{tutorial}/{log_file}','r') as nfRuntimeLogFile: with open(cwd + f'/archives/{tutorial}/{log_file}','r') as nfRuntimeLogFile:
for line in nfRuntimeLogFile: for line in nfRuntimeLogFile:
result = re.search('system.*info.* Bye', line) result = re.search('system.*info.* Bye. Shutdown Procedure took (?P<duration>[0-9]+) ms', line)
if result is not None: if result is not None and not byeMessagePresent:
byeMessagePresent = True byeMessagePresent = True
duration = int(result.group('duration'))
byeMessages.append((containerName, f'{containerName} -- {rootName} properly shutdown in {duration} ms -- See {tutorial}/{log_file} for details', True))
if not byeMessagePresent: if not byeMessagePresent:
print(f'{containerName} -- {tutorial}/{log_file} -- {rootName} does not show Bye message') byeMessages.append((containerName, f'{containerName} -- {tutorial}/{log_file} -- {rootName} does not show Bye message', False))
noByeMessageContainers.append((containerName, f'{tutorial}/{log_file}'))
if tutoName == '': if tutoName == '':
return '' return ''
...@@ -168,8 +169,8 @@ class HtmlReport(): ...@@ -168,8 +169,8 @@ class HtmlReport():
tutoText += generate_command_table_header() tutoText += generate_command_table_header()
for (cmd,cmdStatus) in listOfCmds: for (cmd,cmdStatus) in listOfCmds:
tutoText += generate_command_table_row(cmd, cmdStatus) tutoText += generate_command_table_row(cmd, cmdStatus)
for (containerName, logFile) in noByeMessageContainers: for (containerName, byeMessage, byeStatus) in byeMessages:
tutoText += generate_command_table_row(f'container {containerName} does not show Bye message! See {logFile}', False) tutoText += generate_command_table_row(byeMessage, byeStatus)
tutoText += generate_command_table_footer() tutoText += generate_command_table_footer()
tutoText += generate_button_footer() tutoText += generate_button_footer()
return tutoText return tutoText
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment