Simplify ShowTestID()

make it a non-class function, stateless, more information on the current
CI step (the number).
This commit is contained in:
Robert Schmidt
2025-08-05 09:58:06 +02:00
parent 28ce0dc444
commit dcbb3369e1
2 changed files with 8 additions and 14 deletions

View File

@@ -258,7 +258,6 @@ class OaiCiTest():
self.testCase_id = ''
self.testXMLfiles = []
self.desc = ''
self.ping_args = ''
self.ping_packetloss_threshold = ''
self.ping_rttavg_threshold =''
@@ -891,9 +890,3 @@ class OaiCiTest():
d = f'{SourceCodePath}/cmake_targets'
cmd.run(f'rm -f {d}/build.log.zip')
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')

View File

@@ -409,10 +409,11 @@ def test_in_list(test, list):
def receive_signal(signum, frame):
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
@@ -637,15 +638,15 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
CiTestObj.testCase_id = id
ctx = TestCaseCtx(i, int(id), logPath)
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']
may_fail = test.findtext('may_fail') in ['True', 'true', 'Yes', 'yes']
HTML.desc=CiTestObj.desc
HTML.desc = desc
action = test.findtext('class')
if (CheckClassValidity(xml_class_list, action, id) == False):
task_set_succeeded = False
continue
CiTestObj.ShowTestID()
ShowTestID(ctx, desc)
if not task_set_succeeded and not always_exec:
msg = f"skipping test due to prior error"
logging.warning(msg)