Commit a25c80ff authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'ci-fix-reports' into 'develop'

[CI] Fixing the HTML reporting

See merge request oai/cn5g/oai-cn5g-amf!15
parents f26caa5a 5baaa6c8
......@@ -63,7 +63,8 @@ pipeline {
lock(cn_ci_resource)
gitLabConnection('OAI GitLab')
gitlabBuilds(builds: [
"Build AMF Image",
"Build U18 AMF Image",
"Build RHEL8 AMF Image",
"Static Code Analysis",
"Code Formatting Checker",
"Test with DsTester"
......@@ -133,7 +134,7 @@ pipeline {
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "sleep 10"
amf_tag = "ci-tmp"
rhel_amf_tag = 'ci-temp-pr-' + env.gitlabMergeRequestId + '-' + shortenShaOne
rhel_amf_tag = 'ci-tmp-pr-' + env.gitlabMergeRequestIid + '-' + shortenShaOne
amf_branch = env.gitlabSourceBranch
echo "MR TAG is ${rhel_amf_tag}"
} else {
......@@ -400,7 +401,7 @@ pipeline {
}
try {
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('sudo podman image rm oai-amf:ci-temp', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman image rm oai-amf:ci-tmp', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
}
} catch (Exception e) {
echo "We failed to delete the OAI-AMF temp image"
......
......@@ -20,6 +20,7 @@
# */
#---------------------------------------------------------------------
import glob
import os
import re
import sys
......@@ -157,10 +158,10 @@ class HtmlReport():
self.file.write(buildSummary)
cwd = os.getcwd()
if os.path.isfile(cwd + '/ds_tester_results_oai_cn5g.html'):
newEpcReport = open(cwd + '/ds_tester_results_oai_cn5g_new.html', 'w')
for reportFile in glob.glob('./*results_oai_cn5g.html'):
newEpcReport = open(cwd + '/' + str(reportFile) + '.new', 'w')
buildSummaryDone = True
with open(cwd + '/ds_tester_results_oai_cn5g.html', 'r') as originalEpcReport:
with open(cwd + '/' + str(reportFile), 'r') as originalEpcReport:
for line in originalEpcReport:
result = re.search('Deployment Summary', line)
if (result is not None) and buildSummaryDone:
......@@ -169,20 +170,7 @@ class HtmlReport():
newEpcReport.write(line)
originalEpcReport.close()
newEpcReport.close()
os.rename(cwd + '/ds_tester_results_oai_cn5g_new.html', cwd + '/ds_tester_results_oai_cn5g.html')
if os.path.isfile(cwd + '/deploy_results_oai_cn5g.html'):
newEpcReport = open(cwd + '/deploy_results_oai_cn5g_new.html', 'w')
buildSummaryDone = True
with open(cwd + '/deploy_results_oai_cn5g.html', 'r') as originalEpcReport:
for line in originalEpcReport:
result = re.search('Deployment Summary', line)
if (result is not None) and buildSummaryDone:
newEpcReport.write(buildSummary)
buildSummaryDone = False
newEpcReport.write(line)
originalEpcReport.close()
newEpcReport.close()
os.rename(cwd + '/deploy_results_oai_cn5g_new.html', cwd + '/deploy_results_oai_cn5g.html')
os.rename(cwd + '/' + str(reportFile) + '.new', cwd + '/' + str(reportFile))
def generateFooter(self):
self.file.write(' <div class="well well-lg">End of Build Report -- Copyright <span class="glyphicon glyphicon-copyright-mark"></span> 2020 <a href="http://www.openairinterface.org/">OpenAirInterface</a>. All Rights Reserved.</div>\n')
......
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