@@ -91,6 +91,29 @@ def checkLogsForErrors(log) {
9191 return [foundKeywords, failure, unstable_flag]
9292}
9393
94+ // ===============================================================
95+ //
96+ // Function : pluginCreateSummary
97+ // Inputs : log
98+ // Action : Scans the input log file to for keywords listed above
99+ // Returns : found foundKeywords, failure and/or unstable_flag
100+ // Notes : Used to Check for VectorCAST build errors/problems
101+ //
102+ // ===============================================================
103+
104+ def pluginCreateSummary (inIcon , inText ) {
105+
106+ try {
107+ // Protected code
108+ createSummary icon : inIcon, text : inText
109+
110+ } catch (ExceptionName e1) {
111+
112+ // Catch block
113+ addSummary icon : inIcon, text : inText
114+ }
115+ }
116+
94117// ===============================================================
95118//
96119// Function : checkBuildLogForErrors
@@ -945,7 +968,7 @@ pipeline {
945968
946969 if (VC_useCoverageHistory ) {
947970 if ((currResult != currentBuild. result) && (currentBuild. result == ' FAILURE' )) {
948- createSummary icon : " icon-error icon-xlg" , text : " Code Coverage Decreased"
971+ pluginCreateSummary( " icon-error icon-xlg" , " Code Coverage Decreased" )
949972 currentBuild. description + = " Code coverage decreased. See console log for details\n "
950973 addBadge icon : " icon-error icon-xlg" , text : " Code Coverage Decreased"
951974 }
@@ -1010,7 +1033,7 @@ pipeline {
10101033 summaryText + = " <hr style=\" height:5px;border-width:0;color:gray;background-color:gray\" > "
10111034 summaryText + = readFile(" ${ mpName} _metrics_report.html_tmp" )
10121035
1013- createSummary icon : " icon-document icon-xlg" , text : summaryText
1036+ pluginCreateSummary ( " icon-document icon-xlg" , summaryText)
10141037
10151038 } else {
10161039 if (fileExists(' combined_incr_rebuild.tmp' )) {
@@ -1031,7 +1054,7 @@ pipeline {
10311054
10321055 // If not, something went wrong... Make the build as unstable
10331056 currentBuild. result = ' UNSTABLE'
1034- createSummary icon : " icon-warning icon-xlg" , text : " General Failure"
1057+ pluginCreateSummary ( " icon-warning icon-xlg" , " General Failure" )
10351058 currentBuild. description + = " General Failure, Incremental Build Report or Full Report Not Present. Please see the console for more information\n "
10361059 }
10371060 } else {
@@ -1040,12 +1063,12 @@ pipeline {
10401063 // Blue ocean view doesn't have a summary
10411064
10421065 summaryText + = readFile(" ${ mpName} _full_report.html_tmp" ) + " <br> " + readFile(" ${ mpName} _metrics_report.html_tmp" )
1043- createSummary icon : " icon-document icon-xlg" , text : summaryText
1066+ pluginCreateSummary ( " icon-document icon-xlg" , summaryText)
10441067
10451068 } else {
10461069 // If not, something went wrong... Make the build as unstable
10471070 currentBuild. result = ' UNSTABLE'
1048- createSummary icon : " icon-warning icon-xlg" , text : " General Failure"
1071+ pluginCreateSummary ( " icon-warning icon-xlg" , " General Failure" )
10491072 currentBuild. description + = " General Failure, Full Report or Metrics Report Not Present. Please see the console for more information\n "
10501073 }
10511074 }
0 commit comments