Remove unused CI code
This commit is contained in:
@@ -65,10 +65,6 @@ class HTMLManagement():
|
||||
self.htmlTabIcons = []
|
||||
self.testXMLfiles = []
|
||||
|
||||
self.testUnstable = False
|
||||
self.testMinStableId = '999999'
|
||||
self.testStabilityPointReached = False
|
||||
|
||||
self.htmleNBFailureMsg = ''
|
||||
self.htmlUEFailureMsg = ''
|
||||
|
||||
@@ -219,20 +215,13 @@ class HTMLManagement():
|
||||
|
||||
def CreateHtmlTabFooter(self, passStatus):
|
||||
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
|
||||
testOkEvenIfUnstable = False
|
||||
if self.testUnstable and not passStatus:
|
||||
if self.testStabilityPointReached or self.testMinStableId == '999999':
|
||||
testOkEvenIfUnstable = True
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th bgcolor = "#33CCFF" colspan="3">Final Tab Status</th>\n')
|
||||
if passStatus:
|
||||
self.htmlFile.write(' <th bgcolor = "green" colspan="3"><font color="white">PASS <span class="glyphicon glyphicon-ok"></span> </font></th>\n')
|
||||
else:
|
||||
if testOkEvenIfUnstable:
|
||||
self.htmlFile.write(' <th bgcolor = "orange" colspan="3"><font color="white">KNOWN UNSTABLE SCENARIO <span class="glyphicon glyphicon-exclamation-sign"></span> </font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th bgcolor = "red" colspan="3"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' <th bgcolor = "red" colspan="3"><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
self.htmlFile.write(' </div>\n')
|
||||
@@ -242,10 +231,7 @@ class HTMLManagement():
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html"
|
||||
subprocess.run(cmd, shell=True)
|
||||
else:
|
||||
if testOkEvenIfUnstable:
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-exclamation-sign\"><\/span>/' test_results.html"
|
||||
else:
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html"
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html"
|
||||
subprocess.run(cmd, shell=True)
|
||||
self.htmlFooterCreated = False
|
||||
|
||||
|
||||
@@ -235,9 +235,6 @@ class OaiCiTest():
|
||||
self.FailReportCnt = 0
|
||||
self.testCase_id = ''
|
||||
self.testXMLfiles = []
|
||||
self.testUnstable = False
|
||||
self.testMinStableId = '999999'
|
||||
self.testStabilityPointReached = False
|
||||
self.desc = ''
|
||||
self.ping_args = ''
|
||||
self.ping_packetloss_threshold = ''
|
||||
@@ -975,12 +972,6 @@ class OaiCiTest():
|
||||
SSH.command(f'echo {self.UEPassword} | sudo -S rm ue*.log core* ue_*record.raw ue_*.pcap ue_*txt', '\$', 5)
|
||||
SSH.close()
|
||||
|
||||
def ConditionalExit(self):
|
||||
if self.testUnstable:
|
||||
if self.testStabilityPointReached or self.testMinStableId == '999999':
|
||||
sys.exit(0)
|
||||
sys.exit(1)
|
||||
|
||||
def ShowTestID(self):
|
||||
logging.info(f'\u001B[1m----------------------------------------\u001B[0m')
|
||||
logging.info(f'\u001B[1m Test ID: {self.testCase_id} \u001B[0m')
|
||||
|
||||
+1
-17
@@ -596,14 +596,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0'))
|
||||
HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0'))
|
||||
repeatCount = xmlRoot.findtext('repeatCount',default='1')
|
||||
testStability = xmlRoot.findtext('TestUnstable',default='False')
|
||||
CiTestObj.repeatCounts.append(int(repeatCount))
|
||||
if testStability == 'True':
|
||||
CiTestObj.testUnstable = True
|
||||
HTML.testUnstable = True
|
||||
CiTestObj.testMinStableId = xmlRoot.findtext('TestMinId',default='999999')
|
||||
HTML.testMinStableId = CiTestObj.testMinStableId
|
||||
logging.warning('Test is tagged as Unstable -- starting from TestID ' + str(CiTestObj.testMinStableId))
|
||||
all_tests=xmlRoot.findall('testCase')
|
||||
|
||||
exclusion_tests=exclusion_tests.split()
|
||||
@@ -829,20 +822,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
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')
|
||||
CiTestObj.testStabilityPointReached = True
|
||||
HTML.testStabilityPointReached = True
|
||||
CiTestObj.FailReportCnt += 1
|
||||
if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit:
|
||||
logging.error('\u001B[1;37;41mScenario failed ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m')
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
if CiTestObj.testUnstable and (CiTestObj.testStabilityPointReached or CiTestObj.testMinStableId == '999999'):
|
||||
logging.warning('\u001B[1;30;43mScenario has reached minimal stability point -- Not a Failure\u001B[0m')
|
||||
else:
|
||||
sys.exit('Failed Scenario')
|
||||
sys.exit('Failed Scenario')
|
||||
else:
|
||||
logging.info('\u001B[1;37;42mScenario passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)\u001B[0m')
|
||||
HTML.CreateHtmlTabFooter(True)
|
||||
|
||||
Reference in New Issue
Block a user