From 0d67d44e05f42aa566c3ff988ef0f3dd03819e52 Mon Sep 17 00:00:00 2001 From: Raphael Defosseux <raphael.defosseux@eurecom.fr> Date: Mon, 3 Sep 2018 17:16:51 +0200 Subject: [PATCH] CI: running TDD test even if FDD failed Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr> --- ci-scripts/Jenkinsfile-gitlab | 102 +++++++++++++++------------------- ci-scripts/runTestOnVM.sh | 8 +-- 2 files changed, 48 insertions(+), 62 deletions(-) diff --git a/ci-scripts/Jenkinsfile-gitlab b/ci-scripts/Jenkinsfile-gitlab index 587309d95c..260daef225 100644 --- a/ci-scripts/Jenkinsfile-gitlab +++ b/ci-scripts/Jenkinsfile-gitlab @@ -269,42 +269,35 @@ pipeline { steps { gitlabCommitStatus(name: "Test-FDD-Band7") { script { - if ("MERGE".equals(env.gitlabActionType)) { - FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210', - parameters: [ - string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), - string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), - string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) - ] - } else { - FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210', - parameters: [ - string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), - string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), - booleanParam(name: 'eNB_mergeRequest', value: false) - ] + try { + if ("MERGE".equals(env.gitlabActionType)) { + FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210', + parameters: [ + string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), + string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), + string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), + booleanParam(name: 'eNB_mergeRequest', value: true) + ] + } else { + FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210', + parameters: [ + string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), + string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), + booleanParam(name: 'eNB_mergeRequest', value: false) + ] + } + } catch (Exception e) { + currentBuild.result = 'FAILURE' } } } } post { - // In case of success we really pick the report from the exact slave build number - success { - script { - copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210', - filter: 'test_results*.html', - selector: specific("${FDD_Band7_B210_Status.number}")) - if (fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { - archiveArtifacts artifacts: 'test_results-eNB-CI-FDD-Band7-B210.html' - } - } - } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. Note that we could use that syntax also in case of success. + // slave job. // The only drop-back is that we may retrieve the HTML report of a previous build - cleanup { + always { script { if (!fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) { copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210', @@ -322,42 +315,35 @@ pipeline { steps { gitlabCommitStatus(name: "Test-TDD-Band40") { script { - if ("MERGE".equals(env.gitlabActionType)) { - TDD_Band40_B210_Status = build job: 'eNB-CI-TDD-Band40-B210', - parameters: [ - string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), - string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), - string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), - booleanParam(name: 'eNB_mergeRequest', value: true) - ] - } else { - TDD_Band40_B210_Status = build job: 'eNB-CI-TDD-Band40-B210', - parameters: [ - string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), - string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), - string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), - booleanParam(name: 'eNB_mergeRequest', value: false) - ] + try { + if ("MERGE".equals(env.gitlabActionType)) { + TDD_Band40_B210_Status = build job: 'eNB-CI-TDD-Band40-B210', + parameters: [ + string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), + string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)), + string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)), + booleanParam(name: 'eNB_mergeRequest', value: true) + ] + } else { + TDD_Band40_B210_Status = build job: 'eNB-CI-TDD-Band40-B210', + parameters: [ + string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)), + string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)), + string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)), + booleanParam(name: 'eNB_mergeRequest', value: false) + ] + } + } catch (Exception e) { + currentBuild.result = 'FAILURE' } } } } post { - // In case of success we really pick the report from the exact slave build number - success { - script { - copyArtifacts(projectName: 'eNB-CI-TDD-Band40-B210', - filter: 'test_results*.html', - selector: specific("${TDD_Band40_B210_Status.number}")) - if (fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { - archiveArtifacts artifacts: 'test_results-eNB-CI-TDD-Band40-B210.html' - } - } - } // In case of any non-success, we are retrieving the HTML report of the last completed - // slave job. Note that we could use that syntax also in case of success. + // slave job. // The only drop-back is that we may retrieve the HTML report of a previous build - cleanup { + always { script { if (!fileExists('test_results-eNB-CI-TDD-Band40-B210.html')) { copyArtifacts(projectName: 'eNB-CI-TDD-Band40-B210', diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh index f294a67455..1595273d7f 100755 --- a/ci-scripts/runTestOnVM.sh +++ b/ci-scripts/runTestOnVM.sh @@ -593,9 +593,9 @@ then ssh -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR < $EPC_VM_CMDS rm $EPC_VM_CMDS - echo "echo \"iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 4M -i 1\"" > $VM_CMDS - echo "echo \"COMMAND IS: iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 4M -i 1\" > /home/ubuntu/tmp/cmake_targets/log/iperf_ul_client.txt" > $VM_CMDS - echo "iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 4M -i 1 | tee -a /home/ubuntu/tmp/cmake_targets/log/iperf_ul_client.txt" >> $VM_CMDS + echo "echo \"iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 2M -i 1\"" > $VM_CMDS + echo "echo \"COMMAND IS: iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 2M -i 1\" > /home/ubuntu/tmp/cmake_targets/log/iperf_ul_client.txt" > $VM_CMDS + echo "iperf -c $REAL_EPC_IP_ADDR -u -t 30 -b 2M -i 1 | tee -a /home/ubuntu/tmp/cmake_targets/log/iperf_ul_client.txt" >> $VM_CMDS ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS rm -f $VM_CMDS @@ -674,7 +674,7 @@ then STATUS=-1 else EFFECTIVE_BANDWIDTH=`tail -n3 $ARCHIVES_LOC/iperf_ul_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` - if [[ $EFFECTIVE_BANDWIDTH =~ .*4.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*3.*Mbits.* ]] + if [[ $EFFECTIVE_BANDWIDTH =~ .*2.*Mbits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*1.*Mbits.* ]] then echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH" else -- GitLab