diff --git a/ci-scripts/cls_ci_helper.py b/ci-scripts/cls_ci_helper.py index b8fff32a5e..6b67057c92 100644 --- a/ci-scripts/cls_ci_helper.py +++ b/ci-scripts/cls_ci_helper.py @@ -24,14 +24,14 @@ from typing import NamedTuple import logging class TestCaseCtx(NamedTuple): - test_id: int + test_idx: int logPath: str def Default(logPath): return TestCaseCtx(112233, logPath) def baseFilename(self): # typically, the test ID is of form 001234 (6 digits) - return f"{self.logPath}/{self.test_id:06d}" + return f"{self.logPath}/{self.test_idx:06d}" def archiveArtifact(cmd, ctx, remote_path): base = os.path.basename(remote_path) diff --git a/ci-scripts/cls_cluster.py b/ci-scripts/cls_cluster.py index 8a9919c700..dc97c80acd 100644 --- a/ci-scripts/cls_cluster.py +++ b/ci-scripts/cls_cluster.py @@ -164,7 +164,6 @@ class Cluster: def PullClusterImage(self, HTML, node, images, tag_prefix): logging.debug(f'Pull OC image {images} to server {node}') - self.testCase_id = HTML.testCase_id with cls_cmd.getConnection(node) as cmd: succeeded = OC_login(cmd, self.OCUserName, self.OCPassword, CI_OC_RAN_NAMESPACE) if not succeeded: @@ -211,8 +210,6 @@ class Cluster: logging.debug(f'Building on cluster triggered from server: {node}') self.cmd = cls_cmd.RemoteCmd(node) - self.testCase_id = HTML.testCase_id - # Workaround for some servers, we need to erase completely the workspace self.cmd.cd(lSourcePath) # to reduce the amount of data send to OpenShift, we @@ -412,7 +409,7 @@ class Cluster: # the groovy scripts expects all logs in # //ci-scripts, so copy it there with cls_cmd.LocalCmd() as c: - c.run(f'mkdir -p {os.getcwd()}/test_log_{ctx.test_id}/') - c.run(f'cp -r {ctx.logPath} {os.getcwd()}/test_log_{ctx.test_id}/') + c.run(f'mkdir -p {os.getcwd()}/test_log_{ctx.test_idx}/') + c.run(f'cp -r {ctx.logPath} {os.getcwd()}/test_log_{ctx.test_idx}/') return status diff --git a/ci-scripts/cls_native.py b/ci-scripts/cls_native.py index d96f60bdca..e1b42acf5b 100644 --- a/ci-scripts/cls_native.py +++ b/ci-scripts/cls_native.py @@ -34,9 +34,8 @@ DPDK_PATH = '/opt/dpdk-t2-22.11.0' class Native(): - def Build(ctx, node, test_case, HTML, directory, options): + def Build(ctx, node, HTML, directory, options): logging.debug(f'Building on server: {node}') - HTML.testCase_id = test_case with cls_cmd.getConnection(node) as ssh: base = f"{directory}/cmake_targets" diff --git a/ci-scripts/cls_oai_html.py b/ci-scripts/cls_oai_html.py index cb1ca56542..6e29063192 100644 --- a/ci-scripts/cls_oai_html.py +++ b/ci-scripts/cls_oai_html.py @@ -67,7 +67,7 @@ class HTMLManagement(): self.htmlUEFailureMsg = '' self.startTime = int(round(time.time() * 1000)) - self.testCase_id = '' + self.testCaseIdx = '' self.desc = '' #----------------------------------------------------------- @@ -191,7 +191,7 @@ class HTMLManagement(): self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') @@ -259,7 +259,7 @@ class HTMLManagement(): currentTime = int(round(time.time() * 1000)) - self.startTime self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') if (str(status) == 'OK'): @@ -374,7 +374,7 @@ class HTMLManagement(): addOrangeBK = False self.htmlFile.write(' \n') self.htmlFile.write(' \n') - self.htmlFile.write(' \n') + self.htmlFile.write(' \n') self.htmlFile.write(' \n') self.htmlFile.write(' \n') if (str(status) == 'OK'): diff --git a/ci-scripts/cls_static_code_analysis.py b/ci-scripts/cls_static_code_analysis.py index 63b5b5b6dd..5ed52e4027 100644 --- a/ci-scripts/cls_static_code_analysis.py +++ b/ci-scripts/cls_static_code_analysis.py @@ -88,7 +88,6 @@ class StaticCodeAnalysis(): raise ValueError(f"{lSourcePath=} {node=}") logging.debug('Building on server: ' + node) cmd = cls_cmd.getConnection(node) - self.testCase_id = HTML.testCase_id # on RedHat/CentOS .git extension is mandatory result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository) if result is not None: @@ -187,8 +186,6 @@ class StaticCodeAnalysis(): raise ValueError(f"{lSourcePath=} {node=}") logging.debug('Building on server: ' + node) cmd = cls_cmd.getConnection(node) - self.testCase_id = HTML.testCase_id - check_options = '' if self.ranAllowMerge: check_options = f'--build-arg MERGE_REQUEST=true --build-arg SRC_BRANCH={self.ranBranch}' diff --git a/ci-scripts/main.py b/ci-scripts/main.py index 731298839f..797e008ab3 100644 --- a/ci-scripts/main.py +++ b/ci-scripts/main.py @@ -98,7 +98,7 @@ def ExecuteActionWithParam(action, ctx, node): if proxy_commit is not None: CONTAINERS.proxyCommit = proxy_commit if action == 'Build_eNB': - success = cls_native.Native.Build(ctx, node, HTML.testCase_id, HTML, RAN.eNBSourceCodePath, RAN.Build_eNB_args) + success = cls_native.Native.Build(ctx, node, HTML, RAN.eNBSourceCodePath, RAN.Build_eNB_args) elif action == 'Build_Image': success = CONTAINERS.BuildImage(ctx, node, HTML) elif action == 'Build_Proxy': @@ -308,7 +308,7 @@ def receive_signal(signum, frame): def ShowTestID(ctx, desc): logging.info(f'\u001B[1m----------------------------------------\u001B[0m') - logging.info(f'\u001B[1m Test ID: {ctx.test_id} \u001B[0m') + logging.info(f'\u001B[1m Test #{ctx.test_idx} \u001B[0m') logging.info(f'\u001B[1m {desc} \u001B[0m') logging.info(f'\u001B[1m----------------------------------------\u001B[0m') @@ -470,16 +470,16 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re for index, test in enumerate(all_tests, start=1): if test_runner_abort: task_set_succeeded = False - test_case_id = f"{index:06d}" - ctx = TestCaseCtx(int(test_case_id), logPath) - HTML.testCase_id = test_case_id + test_case_idx = f"{index:06d}" + ctx = TestCaseCtx(int(test_case_idx), logPath) + HTML.testCaseIdx = test_case_idx desc = test.findtext('desc') node = test.findtext('node') if not force_local else 'localhost' always_exec = test.findtext('always_exec') in ['True', 'true', 'Yes', 'yes'] may_fail = test.findtext('may_fail') in ['True', 'true', 'Yes', 'yes'] HTML.desc = desc action = test.findtext('class') - if not CheckClassValidity(xml_class_list, action, test_case_id): + if not CheckClassValidity(xml_class_list, action, test_case_idx): task_set_succeeded = False continue ShowTestID(ctx, desc) @@ -491,9 +491,9 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re try: test_succeeded = ExecuteActionWithParam(action, ctx, node) if not test_succeeded and may_fail: - logging.warning(f"test ID {test_case_id} action {action} may or may not fail, proceeding despite error") + logging.warning(f"test ID {test_case_idx} action {action} may or may not fail, proceeding despite error") elif not test_succeeded: - logging.error(f"test ID {test_case_id} action {action} failed ({test_succeeded}), skipping next tests") + logging.error(f"test ID {test_case_idx} action {action} failed ({test_succeeded}), skipping next tests") task_set_succeeded = False except Exception as e: s = traceback.format_exc() diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py index e440fc3a62..04384ad4f4 100644 --- a/ci-scripts/ran.py +++ b/ci-scripts/ran.py @@ -67,7 +67,6 @@ class RANManagement(): self.eNBOptions = ['', '', ''] self.eNBmbmsEnables = [False, False, False] self.eNBstatuses = [-1, -1, -1] - self.testCase_id = '' self.runtime_stats= '' self.datalog_rt_stats={} self.datalog_rt_stats_file='datalog_rt_stats.default.yaml' @@ -88,7 +87,6 @@ class RANManagement(): raise ValueError(f"{node=}") logging.debug('Starting eNB/gNB on server: ' + node) - self.testCase_id = HTML.testCase_id lSourcePath = self.eNBSourceCodePath cmd = cls_cmd.getConnection(node) diff --git a/ci-scripts/tests/build.py b/ci-scripts/tests/build.py index 013486a560..8701b17a8c 100644 --- a/ci-scripts/tests/build.py +++ b/ci-scripts/tests/build.py @@ -17,7 +17,7 @@ import cls_cmd class TestBuild(unittest.TestCase): def setUp(self): self.html = cls_oai_html.HTMLManagement() - self.html.testCase_id = "000000" + self.html.testCaseIdx = "000000" self.cont = cls_containerize.Containerize() self._d = tempfile.mkdtemp() logging.warning(f"temporary directory: {self._d}")
Relative Time (s)Test IdTest IndexTest DescTest OptionsTest Status
' + format(currentTime / 1000, '.1f') + '' + self.testCase_id + '' + self.testCaseIdx + '' + self.desc + '' + str(options) + '
' + format(currentTime / 1000, '.1f') + '' + self.testCase_id + '' + self.testCaseIdx + '' + self.desc + '' + str(options) + '