Simplify ShowTestID()
make it a non-class function, stateless, more information on the current CI step (the number).
This commit is contained in:
@@ -258,7 +258,6 @@ class OaiCiTest():
|
|||||||
|
|
||||||
self.testCase_id = ''
|
self.testCase_id = ''
|
||||||
self.testXMLfiles = []
|
self.testXMLfiles = []
|
||||||
self.desc = ''
|
|
||||||
self.ping_args = ''
|
self.ping_args = ''
|
||||||
self.ping_packetloss_threshold = ''
|
self.ping_packetloss_threshold = ''
|
||||||
self.ping_rttavg_threshold =''
|
self.ping_rttavg_threshold =''
|
||||||
@@ -891,9 +890,3 @@ class OaiCiTest():
|
|||||||
d = f'{SourceCodePath}/cmake_targets'
|
d = f'{SourceCodePath}/cmake_targets'
|
||||||
cmd.run(f'rm -f {d}/build.log.zip')
|
cmd.run(f'rm -f {d}/build.log.zip')
|
||||||
cmd.run(f'cd {d} && zip -r build.log.zip build_log_*/*')
|
cmd.run(f'cd {d} && zip -r build.log.zip build_log_*/*')
|
||||||
|
|
||||||
def ShowTestID(self):
|
|
||||||
logging.info(f'\u001B[1m----------------------------------------\u001B[0m')
|
|
||||||
logging.info(f'\u001B[1m Test ID: {self.testCase_id} \u001B[0m')
|
|
||||||
logging.info(f'\u001B[1m {self.desc} \u001B[0m')
|
|
||||||
logging.info(f'\u001B[1m----------------------------------------\u001B[0m')
|
|
||||||
|
|||||||
+8
-7
@@ -409,10 +409,11 @@ def test_in_list(test, list):
|
|||||||
def receive_signal(signum, frame):
|
def receive_signal(signum, frame):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
def ShowTestID(ctx, desc):
|
||||||
|
logging.info(f'\u001B[1m----------------------------------------\u001B[0m')
|
||||||
|
logging.info(f'\u001B[1m Test ID: {ctx.test_id} (#{ctx.count}) \u001B[0m')
|
||||||
|
logging.info(f'\u001B[1m {desc} \u001B[0m')
|
||||||
|
logging.info(f'\u001B[1m----------------------------------------\u001B[0m')
|
||||||
|
|
||||||
#-----------------------------------------------------------
|
#-----------------------------------------------------------
|
||||||
# MAIN PART
|
# MAIN PART
|
||||||
@@ -637,15 +638,15 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
|||||||
CiTestObj.testCase_id = id
|
CiTestObj.testCase_id = id
|
||||||
ctx = TestCaseCtx(i, int(id), logPath)
|
ctx = TestCaseCtx(i, int(id), logPath)
|
||||||
HTML.testCase_id=CiTestObj.testCase_id
|
HTML.testCase_id=CiTestObj.testCase_id
|
||||||
CiTestObj.desc = test.findtext('desc')
|
desc = test.findtext('desc')
|
||||||
always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes']
|
always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes']
|
||||||
may_fail = test.findtext('may_fail') in ['True', 'true', 'Yes', 'yes']
|
may_fail = test.findtext('may_fail') in ['True', 'true', 'Yes', 'yes']
|
||||||
HTML.desc=CiTestObj.desc
|
HTML.desc = desc
|
||||||
action = test.findtext('class')
|
action = test.findtext('class')
|
||||||
if (CheckClassValidity(xml_class_list, action, id) == False):
|
if (CheckClassValidity(xml_class_list, action, id) == False):
|
||||||
task_set_succeeded = False
|
task_set_succeeded = False
|
||||||
continue
|
continue
|
||||||
CiTestObj.ShowTestID()
|
ShowTestID(ctx, desc)
|
||||||
if not task_set_succeeded and not always_exec:
|
if not task_set_succeeded and not always_exec:
|
||||||
msg = f"skipping test due to prior error"
|
msg = f"skipping test due to prior error"
|
||||||
logging.warning(msg)
|
logging.warning(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user