Compare commits
4 Commits
1.0.8.post
...
1.0.8.post
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd3389aeb2 | ||
|
|
886a22bef2 | ||
|
|
e9355471ba | ||
|
|
3bbbe946a1 |
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
@@ -11,6 +11,7 @@ import static javax.xml.xpath.XPathConstants.*
|
||||
import javax.xml.xpath.*
|
||||
import groovy.xml.DOMBuilder
|
||||
import groovy.xml.dom.DOMCategory
|
||||
import java.math.RoundingMode
|
||||
|
||||
// configurable settings:
|
||||
// use to send email if workflow problem
|
||||
@@ -73,8 +74,9 @@ String ExtractBaseVersion(inVersion) {
|
||||
|
||||
int GetCoverageValue(String CoverageFilePath,String XPath)
|
||||
{
|
||||
File file = new File(CoverageFilePath)
|
||||
coverageReportRaw = file.getText('UTF-8')
|
||||
//File file = new File(CoverageFilePath)
|
||||
//coverageReportRaw = file.getText('UTF-8')
|
||||
coverageReportRaw = readFile(CoverageFilePath)
|
||||
coverageReport = DOMBuilder.parse(new StringReader(coverageReportRaw), false, false)
|
||||
coverageReportRoot = coverageReport.documentElement
|
||||
|
||||
@@ -89,7 +91,7 @@ int GetCoverageValue_line_rate(String CoverageFilePath) { return GetCoverageValu
|
||||
int GetCoverageValue_branches_valid(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-valid") }
|
||||
int GetCoverageValue_branches_covered(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-covered") }
|
||||
int GetCoverageValue_branch_rate(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branch-rate") }
|
||||
int GetCoverageValue_branches_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@branches-complexity") }
|
||||
int GetCoverageValue_complexity(String CoverageFilePath) { return GetCoverageValue(CoverageFilePath,"/coverage/@complexity") }
|
||||
|
||||
|
||||
pipeline {
|
||||
@@ -439,11 +441,13 @@ pipeline {
|
||||
println GetCoverageValue_branch_rate(coverage_report_path)
|
||||
println GetCoverageValue_branches_complexity(coverage_report_path)
|
||||
|
||||
full_rate = (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2
|
||||
badge_coverage.setStatus(full_rate)
|
||||
full_rate = 1.0 * (GetCoverageValue_line_rate(coverage_report_path) + GetCoverageValue_branch_rate(coverage_report_path)) / 2
|
||||
sz_full_rate =Float.toString(full_rate.setScale(2, RoundingMode.HALF_EVEN))
|
||||
badge_coverage.setStatus(sz_full_rate)
|
||||
|
||||
complexity = GetCoverageValue_branches_complexity(coverage_report_path)
|
||||
badge_complexity.setStatus(complexity)
|
||||
complexity = 1.0 * GetCoverageValue_complexity(coverage_report_path)
|
||||
sz_complexity =Float.toString(complexity.setScale(2, RoundingMode.HALF_EVEN))
|
||||
badge_complexity.setStatus(sz_complexity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user