From c481aad0c8bd6c380aae432d3c59edd4c8784d55 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 2 Oct 2023 13:26:26 +0200 Subject: [PATCH 1/3] chore(ci): all pipelines should have the MR ID and branch in the description Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-cluster | 7 ++++++ ci-scripts/Jenkinsfile-nrue | 7 ++++++ ci-scripts/Jenkinsfile-physim-deploy | 7 ++++++ ci-scripts/Jenkinsfile-tmp-full-ran | 7 ++++++ ci-scripts/Jenkinsfile-tmp-multi-enb | 7 ++++++ ci-scripts/Jenkinsfile-tmp-ran | 32 ++++++---------------------- 6 files changed, 42 insertions(+), 25 deletions(-) diff --git a/ci-scripts/Jenkinsfile-cluster b/ci-scripts/Jenkinsfile-cluster index 65774c3280..40e54a9839 100644 --- a/ci-scripts/Jenkinsfile-cluster +++ b/ci-scripts/Jenkinsfile-cluster @@ -67,6 +67,13 @@ pipeline { } stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ('Verify Parameters') { steps { script { diff --git a/ci-scripts/Jenkinsfile-nrue b/ci-scripts/Jenkinsfile-nrue index da14750c3c..610e2867f0 100644 --- a/ci-scripts/Jenkinsfile-nrue +++ b/ci-scripts/Jenkinsfile-nrue @@ -61,6 +61,13 @@ pipeline { } stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ('Verify Parameters') { steps { script { diff --git a/ci-scripts/Jenkinsfile-physim-deploy b/ci-scripts/Jenkinsfile-physim-deploy index dac812e922..c90b254242 100644 --- a/ci-scripts/Jenkinsfile-physim-deploy +++ b/ci-scripts/Jenkinsfile-physim-deploy @@ -61,6 +61,13 @@ pipeline { } stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ('Verify Parameters') { steps { script { diff --git a/ci-scripts/Jenkinsfile-tmp-full-ran b/ci-scripts/Jenkinsfile-tmp-full-ran index 5ee06cc585..54a338d16d 100644 --- a/ci-scripts/Jenkinsfile-tmp-full-ran +++ b/ci-scripts/Jenkinsfile-tmp-full-ran @@ -66,6 +66,13 @@ pipeline { } stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ("Verify Parameters") { steps { script { diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb b/ci-scripts/Jenkinsfile-tmp-multi-enb index 0a1b944c5f..74b04a5cb9 100644 --- a/ci-scripts/Jenkinsfile-tmp-multi-enb +++ b/ci-scripts/Jenkinsfile-tmp-multi-enb @@ -54,6 +54,13 @@ pipeline { lock(extra: lockResources) } stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ("Verify Parameters") { steps { script { diff --git a/ci-scripts/Jenkinsfile-tmp-ran b/ci-scripts/Jenkinsfile-tmp-ran index cddd72e23b..cf9dce5e09 100644 --- a/ci-scripts/Jenkinsfile-tmp-ran +++ b/ci-scripts/Jenkinsfile-tmp-ran @@ -66,32 +66,14 @@ pipeline { ansiColor('xterm') lock(extra: lockResources) } - // the following parameter options are commented out so it shows the ones - // that you SHALL have to run the job. - // You can use them as template - /* - parameters { - //node-test parameters - string(name: 'pythonExecutor', defaultValue: 'nodea', description: 'Node where the pipeline - python scripts will be executed') - string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run') - string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage') - booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact') - string(name: 'lockResources', defaultValue: 'CI-Bench-1-Phones', description: 'Lockeable Resource to prevent multiple jobs to run simultaneously with the same resource') - - //eNB parameters - string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB') - credentials(name: 'eNB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for eNB') - string(name: 'eNB_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of eNB source code') - - //EPC parameters - string(name: 'EPC_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of EPC') - string(name: 'EPC_Type', defaultValue: 'ltebox', description: 'EPC type: OAI or ltebox') - credentials(name: 'EPC_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for EPC') - string(name: 'EPC_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of EPC source code') - } - */ - stages { + stage("Build Init") { + steps { + // update the build name and description + buildName "${params.eNB_MR}" + buildDescription "Branch : ${params.eNB_Branch}" + } + } stage ("Verify Parameters") { steps { script { From 06e63f7ccab0a2334d2afb24155c18b765c02e12 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 2 Oct 2023 13:27:05 +0200 Subject: [PATCH 2/3] chore(ci): report in the GitLab MR comment the list of failing test stages Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index 2f94a3e318..ca3675912a 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -31,6 +31,9 @@ def do5Gtest = false // def gitCommitAuthorEmailAddr +// list of failing stages +def failingStages = '' + pipeline { agent { label nodeExecutor @@ -136,6 +139,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-Ubuntu18-Image-Builder' } } } @@ -155,6 +159,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-RHEL8-Cluster-Image-Builder' } } } @@ -174,6 +179,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-cppcheck' } } } @@ -199,6 +205,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-PhySim-Cluster' } } } @@ -219,6 +226,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-RF-Sim-Test-4G' } } } @@ -239,6 +247,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-RF-Sim-Test-5G' } } } @@ -259,6 +268,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-L2-Sim-Test-4G' } } } @@ -279,6 +289,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-L2-Sim-Test-5G' } } } @@ -299,6 +310,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-LTE-FDD-LTEBOX-Container' } } } @@ -320,6 +332,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-LTE-FDD-OAIUE-OAICN4G-Container' } } } @@ -340,6 +353,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-LTE-TDD-LTEBOX-Container' } } } @@ -360,6 +374,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-NSA-B200-Module-LTEBOX-Container' } } } @@ -380,6 +395,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-SA-B200-Module-SABOX-Container' } } } @@ -400,6 +416,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-gNB-N300-Timing-Phytest-LDPC' } } } @@ -420,6 +437,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-LTE-TDD-2x2-Container' } } } @@ -440,6 +458,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-SA-AW2S-CN5G' } } } @@ -460,6 +479,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-Interop-F1' } } } @@ -480,6 +500,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * OAI-CN5G-COTS-UE-Test' } } } @@ -500,6 +521,7 @@ pipeline { failure { script { currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-SA-OAIUE-CN5G' } } } @@ -518,6 +540,7 @@ pipeline { script { echo "Push to Docker-Hub KO" currentBuild.result = 'FAILURE' + failingStages += '\n * RAN-DockerHub-Push' } } } @@ -541,7 +564,8 @@ pipeline { script { def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")" if ("MERGE".equals(env.gitlabActionType)) { - addGitLabMRComment comment: message + def fullMessage = message + '\n\nList of failing test stages:' + failingStages + addGitLabMRComment comment: fullMessage def message2 = message + " -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")" sendSocialMediaMessage('ci-enb', 'danger', message2) } else { From f9ab9ca1375a02f9a1637f10c011b16f3eb4c09c Mon Sep 17 00:00:00 2001 From: Raphael Defosseux Date: Mon, 2 Oct 2023 14:08:11 +0200 Subject: [PATCH 3/3] chore(ci): the failing test-case bullet will directly point to the HTML report Signed-off-by: Raphael Defosseux --- ci-scripts/Jenkinsfile-GitLab-Container | 84 +++++++++++++------------ 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container index ca3675912a..c73edd576e 100644 --- a/ci-scripts/Jenkinsfile-GitLab-Container +++ b/ci-scripts/Jenkinsfile-GitLab-Container @@ -32,7 +32,7 @@ def do5Gtest = false def gitCommitAuthorEmailAddr // list of failing stages -def failingStages = '' +def failingStages = "" pipeline { agent { @@ -133,13 +133,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-Ubuntu18-Image-Builder') + testBullet = finalizeSlaveJob('RAN-Ubuntu18-Image-Builder') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-Ubuntu18-Image-Builder' + failingStages += testBullet } } } @@ -153,13 +153,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-RHEL8-Cluster-Image-Builder') + testBullet = finalizeSlaveJob('RAN-RHEL8-Cluster-Image-Builder') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-RHEL8-Cluster-Image-Builder' + failingStages += testBullet } } } @@ -173,13 +173,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-cppcheck') + testBullet = finalizeSlaveJob('RAN-cppcheck') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-cppcheck' + failingStages += testBullet } } } @@ -199,13 +199,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-PhySim-Cluster') + testBullet = finalizeSlaveJob('RAN-PhySim-Cluster') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-PhySim-Cluster' + failingStages += testBullet } } } @@ -220,13 +220,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-RF-Sim-Test-4G') + testBullet = finalizeSlaveJob('RAN-RF-Sim-Test-4G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-RF-Sim-Test-4G' + failingStages += testBullet } } } @@ -241,13 +241,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-RF-Sim-Test-5G') + testBullet = finalizeSlaveJob('RAN-RF-Sim-Test-5G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-RF-Sim-Test-5G' + failingStages += testBullet } } } @@ -262,13 +262,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-L2-Sim-Test-4G') + testBullet = finalizeSlaveJob('RAN-L2-Sim-Test-4G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-L2-Sim-Test-4G' + failingStages += testBullet } } } @@ -283,13 +283,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-L2-Sim-Test-5G') + testBullet = finalizeSlaveJob('RAN-L2-Sim-Test-5G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-L2-Sim-Test-5G' + failingStages += testBullet } } } @@ -304,13 +304,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-LTE-FDD-LTEBOX-Container') + testBullet = finalizeSlaveJob('RAN-LTE-FDD-LTEBOX-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-LTE-FDD-LTEBOX-Container' + failingStages += testBullet } } } @@ -326,13 +326,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-LTE-FDD-OAIUE-OAICN4G-Container') + testBullet = finalizeSlaveJob('RAN-LTE-FDD-OAIUE-OAICN4G-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-LTE-FDD-OAIUE-OAICN4G-Container' + failingStages += testBullet } } } @@ -347,13 +347,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-LTE-TDD-LTEBOX-Container') + testBullet = finalizeSlaveJob('RAN-LTE-TDD-LTEBOX-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-LTE-TDD-LTEBOX-Container' + failingStages += testBullet } } } @@ -368,13 +368,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-NSA-B200-Module-LTEBOX-Container') + testBullet = finalizeSlaveJob('RAN-NSA-B200-Module-LTEBOX-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-NSA-B200-Module-LTEBOX-Container' + failingStages += testBullet } } } @@ -389,13 +389,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-SA-B200-Module-SABOX-Container') + testBullet = finalizeSlaveJob('RAN-SA-B200-Module-SABOX-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-SA-B200-Module-SABOX-Container' + failingStages += testBullet } } } @@ -410,13 +410,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-gNB-N300-Timing-Phytest-LDPC') + testBullet = finalizeSlaveJob('RAN-gNB-N300-Timing-Phytest-LDPC') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-gNB-N300-Timing-Phytest-LDPC' + failingStages += testBullet } } } @@ -431,13 +431,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-LTE-TDD-2x2-Container') + testBullet = finalizeSlaveJob('RAN-LTE-TDD-2x2-Container') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-LTE-TDD-2x2-Container' + failingStages += testBullet } } } @@ -452,13 +452,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-SA-AW2S-CN5G') + testBullet = finalizeSlaveJob('RAN-SA-AW2S-CN5G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-SA-AW2S-CN5G' + failingStages += testBullet } } } @@ -473,13 +473,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-Interop-F1') + testBullet = finalizeSlaveJob('RAN-Interop-F1') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-Interop-F1' + failingStages += testBullet } } } @@ -494,13 +494,13 @@ pipeline { post { always { script { - finalizeSlaveJob('OAI-CN5G-COTS-UE-Test') + testBullet = finalizeSlaveJob('OAI-CN5G-COTS-UE-Test') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * OAI-CN5G-COTS-UE-Test' + failingStages += testBullet } } } @@ -515,13 +515,13 @@ pipeline { post { always { script { - finalizeSlaveJob('RAN-SA-OAIUE-CN5G') + testBullet = finalizeSlaveJob('RAN-SA-OAIUE-CN5G') } } failure { script { currentBuild.result = 'FAILURE' - failingStages += '\n * RAN-SA-OAIUE-CN5G' + failingStages += testBullet } } } @@ -675,6 +675,7 @@ def finalizeSlaveJob(jobName) { } else { fileName = "test_results-${jobName}.html" } + artifactUrl = BUILD_URL if (!fileExists(fileName)) { copyArtifacts(projectName: jobName, filter: 'test_results*.html', @@ -682,8 +683,13 @@ def finalizeSlaveJob(jobName) { if (fileExists(fileName)) { sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}" archiveArtifacts artifacts: fileName + // BUILD_URL is like http://server:port/jenkins/job/foo/15/ + // no need to add a prefixed '/' + artifactUrl += 'artifact/' + fileName } } + artifactUrl = "\n * [${jobName}](${artifactUrl})" + return artifactUrl } // Abstraction function to send social media messages: