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 { ...@@ -63,7 +63,8 @@ pipeline {
lock(cn_ci_resource) lock(cn_ci_resource)
gitLabConnection('OAI GitLab') gitLabConnection('OAI GitLab')
gitlabBuilds(builds: [ gitlabBuilds(builds: [
"Build AMF Image", "Build U18 AMF Image",
"Build RHEL8 AMF Image",
"Static Code Analysis", "Static Code Analysis",
"Code Formatting Checker", "Code Formatting Checker",
"Test with DsTester" "Test with DsTester"
...@@ -133,7 +134,7 @@ pipeline { ...@@ -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 "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "sleep 10" sh "sleep 10"
amf_tag = "ci-tmp" 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 amf_branch = env.gitlabSourceBranch
echo "MR TAG is ${rhel_amf_tag}" echo "MR TAG is ${rhel_amf_tag}"
} else { } else {
...@@ -400,7 +401,7 @@ pipeline { ...@@ -400,7 +401,7 @@ pipeline {
} }
try { try {
if ("MERGE".equals(env.gitlabActionType)) { 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) { } catch (Exception e) {
echo "We failed to delete the OAI-AMF temp image" echo "We failed to delete the OAI-AMF temp image"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# */ # */
#--------------------------------------------------------------------- #---------------------------------------------------------------------
import glob
import os import os
import re import re
import sys import sys
...@@ -157,10 +158,10 @@ class HtmlReport(): ...@@ -157,10 +158,10 @@ class HtmlReport():
self.file.write(buildSummary) self.file.write(buildSummary)
cwd = os.getcwd() cwd = os.getcwd()
if os.path.isfile(cwd + '/ds_tester_results_oai_cn5g.html'): for reportFile in glob.glob('./*results_oai_cn5g.html'):
newEpcReport = open(cwd + '/ds_tester_results_oai_cn5g_new.html', 'w') newEpcReport = open(cwd + '/' + str(reportFile) + '.new', 'w')
buildSummaryDone = True 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: for line in originalEpcReport:
result = re.search('Deployment Summary', line) result = re.search('Deployment Summary', line)
if (result is not None) and buildSummaryDone: if (result is not None) and buildSummaryDone:
...@@ -169,20 +170,7 @@ class HtmlReport(): ...@@ -169,20 +170,7 @@ class HtmlReport():
newEpcReport.write(line) newEpcReport.write(line)
originalEpcReport.close() originalEpcReport.close()
newEpcReport.close() newEpcReport.close()
os.rename(cwd + '/ds_tester_results_oai_cn5g_new.html', cwd + '/ds_tester_results_oai_cn5g.html') os.rename(cwd + '/' + str(reportFile) + '.new', cwd + '/' + str(reportFile))
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')
def generateFooter(self): 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') 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