mirror of
https://github.com/valitydev/service-parent-pom.git
synced 2024-11-06 01:45:19 +00:00
Move script to a separate repo
This commit is contained in:
parent
44c720655b
commit
b45c288e13
2
pom.xml
2
pom.xml
@ -312,7 +312,7 @@
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<source>https://raw.githubusercontent.com/rbkmoney/service-parent-pom/master/scripts/TestCoverageAnalysis.groovy</source>
|
||||
<source>https://raw.githubusercontent.com/rbkmoney/test-coverage-analysis-script/master/TestCoverageAnalysis.groovy</source>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -1,36 +0,0 @@
|
||||
def ansiCyan = "\u001B[36m"
|
||||
def ansiBlue = "\u001B[34m"
|
||||
def ansiYellow = "\u001B[33m"
|
||||
def ansiReset = "\u001B[0m"
|
||||
|
||||
def reportFile = new File("target/site/jacoco/index.html")
|
||||
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] ------------------------------------------------------------------------"
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] " + ansiCyan + "TEST COVERAGE ANALYSIS" + ansiReset
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] ------------------------------------------------------------------------"
|
||||
|
||||
if (!reportFile.exists() || !reportFile.canRead()) {
|
||||
println "[" + ansiYellow + "WARN" + ansiReset + "] Unable to find jacoco report file in ./target/site/jacoco/index.html"
|
||||
return
|
||||
}
|
||||
|
||||
reportFile.withReader('UTF-8') { reader ->
|
||||
def html = parser().parseText(reader.readLine())
|
||||
def totalRow = html.body.table.tfoot.tr
|
||||
def instructionsMissed = totalRow.td[1]
|
||||
def instructionsCoverage = totalRow.td[2]
|
||||
def branchesMissed = totalRow.td[3]
|
||||
def branchesCoverage = totalRow.td[4]
|
||||
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] Instructions ${instructionsCoverage} (Missed ${instructionsMissed})"
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] Branches ${branchesCoverage} (Missed ${branchesMissed})"
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "]"
|
||||
println "[" + ansiBlue + "INFO" + ansiReset + "] For more information: open ./target/site/jacoco/index.html"
|
||||
}
|
||||
|
||||
XmlSlurper parser() {
|
||||
parser = new XmlSlurper()
|
||||
parser.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false)
|
||||
parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
|
||||
return parser
|
||||
}
|
Loading…
Reference in New Issue
Block a user