Add support for Scoverage plugin

The Jenkins Scoverage plugin allows one to publish Jenkins scoverage
results as a trend graph. It allows the following options to be configured:
   *the location where the xml report is generated
   *the name of the xml report file

Change-Id: I2529fe69f6dc26b79390f19129411554ccb650c9
This commit is contained in:
Deanna 2015-04-07 00:50:11 -04:00
parent d976466c10
commit 91667b58a9
4 changed files with 38 additions and 0 deletions

View File

@ -3985,6 +3985,30 @@ def conditional_publisher(parser, xml_parent, data):
raise JenkinsJobsException('action must be set for each condition')
def scoverage(parser, xml_parent, data):
"""yaml: scoverage
Publish scoverage results as a trend graph.
Requires the Jenkins :jenkins-wiki:`Scoverage Plugin <Scoverage+Plugin>`.
:arg str report-directory: This is a directory that specifies the locations
where the xml scoverage report is generated
:arg str report-file: This is a file name that is given to the xml
scoverage report.
Example:
.. literalinclude:: /../../tests/publishers/fixtures/scoverage001.yaml
:language: yaml
"""
scoverage = XML.SubElement(
xml_parent,
'org.jenkinsci.plugins.scoverage.ScoveragePublisher')
XML.SubElement(scoverage, 'reportDirectory').text = str(
data.get('report-directory', ''))
XML.SubElement(scoverage, 'reportFile').text = str(
data.get('report-file', ''))
class Publishers(jenkins_jobs.modules.base.Base):
sequence = 70

View File

@ -169,6 +169,7 @@ jenkins_jobs.publishers =
ruby-metrics=jenkins_jobs.modules.publishers:ruby_metrics
s3=jenkins_jobs.modules.publishers:s3
scan-build=jenkins_jobs.modules.publishers:scan_build
scoverage=jenkins_jobs.modules.publishers:scoverage
scp=jenkins_jobs.modules.publishers:scp
shining-panda=jenkins_jobs.modules.publishers:shining_panda
sitemonitor=jenkins_jobs.modules.publishers:sitemonitor

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.scoverage.ScoveragePublisher>
<reportDirectory>target/scala-2.10/scoverage-report/</reportDirectory>
<reportFile>scoverage.xml</reportFile>
</org.jenkinsci.plugins.scoverage.ScoveragePublisher>
</publishers>
</project>

View File

@ -0,0 +1,4 @@
publishers:
- scoverage:
report-directory: target/scala-2.10/scoverage-report/
report-file: scoverage.xml