Commit 9d92f4f9 authored by Robert Schmidt's avatar Robert Schmidt

CI: catch exceptions in CI code and print in HTML

parent 31d04336
......@@ -65,6 +65,7 @@ import logging
import datetime
import signal
import subprocess
import traceback
from multiprocessing import Process, Lock, SimpleQueue
logging.basicConfig(
level=logging.DEBUG,
......@@ -745,6 +746,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
continue
CiTestObj.ShowTestID()
GetParametersFromXML(action)
try:
if action == 'Build_eNB':
RAN.BuildeNB(HTML)
elif action == 'WaitEndBuild_eNB':
......@@ -889,6 +891,12 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
logging.debug('To be implemented')
else:
sys.exit('Invalid class (action) from xml')
except Exception as e:
s = traceback.format_exc()
logging.error(f'while running CI, an exception occurred:\n{s}')
HTML.CreateHtmlTestRowQueue("N/A", 'KO', [f"CI test code encountered an exception:\n{s}"])
RAN.prematureExit = True
if RAN.prematureExit:
if CiTestObj.testCase_id == CiTestObj.testMinStableId:
logging.warning('Scenario has reached minimal stability point')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment