Update cloverphp plugin

- update cloverphp docs to be 4 space indent
- add plugin="cloverphp" attribute
- remove the trailing \

Change-Id: Iad6dc770bfb04ba1318fef7dcf039f7ec44d67b9
This commit is contained in:
Dong Ma 2016-09-12 10:22:11 +08:00
parent 6853cf5ae7
commit bce839b41e
4 changed files with 17 additions and 16 deletions

View File

@ -699,26 +699,26 @@ def cloverphp(registry, xml_parent, data):
has to be filled in the `xml-location` field.
:arg str xml-location: Path to the coverage XML file generated by PHPUnit
using --coverage-clover. Relative to workspace. (required)
using --coverage-clover. Relative to workspace. (required)
:arg dict html: When existent, whether the plugin should generate a HTML
report. Note that PHPUnit already provide a HTML report via its
--cover-html option which can be set in your builder (optional):
report. Note that PHPUnit already provide a HTML report via its
--cover-html option which can be set in your builder (optional):
* **dir** (str): Directory where HTML report will be generated relative
to workspace. (required in `html` dict).
* **archive** (bool): Whether to archive HTML reports (default true).
:arg list metric-targets: List of metric targets to reach, must be one of
**healthy**, **unhealthy** and **failing**. Each metric target can takes
two parameters:
**healthy**, **unhealthy** and **failing**. Each metric target can
takes two parameters:
* **method** Target for method coverage
* **statement** Target for statements coverage
Whenever a metric target is not filled in, the Jenkins plugin can fill in
defaults for you (as of v0.3.3 of the plugin the healthy target will have
method: 70 and statement: 80 if both are left empty). Jenkins Job Builder
will mimic that feature to ensure clean configuration diff.
Whenever a metric target is not filled in, the Jenkins plugin can fill
in defaults for you (as of v0.3.3 of the plugin the healthy target will
have method: 70 and statement: 80 if both are left empty). Jenkins Job
Builder will mimic that feature to ensure clean configuration diff.
Minimal example:
@ -733,6 +733,7 @@ def cloverphp(registry, xml_parent, data):
cloverphp = XML.SubElement(
xml_parent,
'org.jenkinsci.plugins.cloverphp.CloverPHPPublisher')
cloverphp.set('plugin', 'cloverphp')
# The plugin requires clover XML file to parse
if 'xml-location' not in data:
@ -752,13 +753,13 @@ def cloverphp(registry, xml_parent, data):
# No point in going further, the plugin would not work
raise JenkinsJobsException('htmldir is required in a html block')
XML.SubElement(cloverphp, 'publishHtmlReport').text = \
str(html_publish).lower()
XML.SubElement(cloverphp, 'publishHtmlReport').text = str(
html_publish).lower()
if html_publish:
XML.SubElement(cloverphp, 'reportDir').text = html_dir
XML.SubElement(cloverphp, 'xmlLocation').text = data.get('xml-location')
XML.SubElement(cloverphp, 'disableArchiving').text = \
str(not html_archive).lower()
XML.SubElement(cloverphp, 'disableArchiving').text = str(
not html_archive).lower()
# Handle targets

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher plugin="cloverphp">
<publishHtmlReport>false</publishHtmlReport>
<xmlLocation>build/clover.xml</xmlLocation>
<disableArchiving>false</disableArchiving>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher plugin="cloverphp">
<publishHtmlReport>true</publishHtmlReport>
<reportDir>html</reportDir>
<xmlLocation>build/clover.xml</xmlLocation>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher>
<org.jenkinsci.plugins.cloverphp.CloverPHPPublisher plugin="cloverphp">
<publishHtmlReport>false</publishHtmlReport>
<xmlLocation>build/clover.xml</xmlLocation>
<disableArchiving>false</disableArchiving>