diff --git a/ci-scripts/Jenkinsfile-GitLab-Docker b/ci-scripts/Jenkinsfile-GitLab-Docker index f2416ded310d702265dc9e31e610842bb3209620..0afea0b7bc412d601f5f66bb08230995f9b15232 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Docker +++ b/ci-scripts/Jenkinsfile-GitLab-Docker @@ -345,6 +345,36 @@ pipeline { } } } + // Home-made RAN emulator + stage ('Robot-Test') { + steps { + script { + gitlabCommitStatus(name: "Robot-Test") { + localStatus = build job: 'OAI-CN5G-RobotTest', + parameters: [ + string(name: 'PCF_TAG', value: String.valueOf(pcf_tag)), + string(name: 'PCF_BRANCH', value: String.valueOf(pcf_branch)) + ], propagate: false + localResult = localStatus.getResult() + + if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) { + echo "Robot-Test is OK" + } else { + error "Robot-Test is is KO" + } + } + } + } + post { + always { + script { + copyArtifacts(projectName: 'OAI-CN5G-RobotTest', + filter: '*.html', + selector: lastCompleted()) + } + } + } + } } } // We are only publishing the Ubuntu image to Docker-Hub diff --git a/ci-scripts/generateHtmlReport.py b/ci-scripts/generateHtmlReport.py index 1bfde95c051e76402f512f75424af0da68f254bf..e679f1373c848cbe21cd61109ed02ffb6df9464c 100755 --- a/ci-scripts/generateHtmlReport.py +++ b/ci-scripts/generateHtmlReport.py @@ -67,15 +67,23 @@ class HtmlReport(): gitInfo = generate_git_info(args) cwd = os.getcwd() for reportFile in os.listdir(cwd): - if reportFile.endswith('.html') and re.search('results_oai_cn5g_', reportFile) is not None: + if reportFile.endswith('.html') and (re.search('results_oai_cn5g_', reportFile) is not None or re.search('test_results_robot_', reportFile) is not None): newFile = '' + robotBuildUrl = '' gitInfoAppended = False with open(os.path.join(cwd, reportFile), 'r') as rfile: for line in rfile: if re.search('<h2>', line) is not None and not gitInfoAppended: gitInfoAppended = True newFile += gitInfo - newFile += line + if re.search('OAI-CN5G-RobotTest -- Build-ID', line) is not None: + result = re.search('href="(?P<build_url>[a-zA-Z0-9\-\:\/\.]+)"', line) + if result is not None: + robotBuildUrl = result.group('build_url') + if re.search('archives/log.html', line) is not None: + newFile += re.sub('archives', f'{robotBuildUrl}/artifact/archives', line) + else: + newFile += line with open(os.path.join(cwd, reportFile), 'w') as wfile: wfile.write(newFile)