Tests for checkstyle publisher

Should be straightforward, the publisher checkstyle simply lacked tests.
Also make use of literal include for the examples.

Change-Id: I000cdee47bb0938af9f327bcaba06b87f8287739
This commit is contained in:
Antoine Musso 2014-04-05 21:27:23 +02:00
parent 3ddbf020e0
commit fc776f009a
7 changed files with 127 additions and 12 deletions

View File

@ -1060,19 +1060,14 @@ def checkstyle(parser, xml_parent, data):
:arg str defaultEncoding: encoding for parsing or showing files
(empty will use platform default)
Example::
Example:
.. literalinclude:: /../../tests/publishers/fixtures/checkstyle001.yaml
Full example:
.. literalinclude:: /../../tests/publishers/fixtures/checkstyle002.yaml
publishers:
- checkstyle:
pattern: '**/checkstyle-result.xml'
healthy: 0
unHealthy: 100
healthThreshold: 'high'
thresholds:
unstable:
totalHigh: 10
failed:
totalHigh: 1
"""
checkstyle = XML.SubElement(xml_parent,
'hudson.plugins.checkstyle.'

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.checkstyle.CheckStylePublisher>
<healthy/>
<unHealthy>100</unHealthy>
<thresholdLimit>high</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding/>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll/>
<unstableTotalHigh>10</unstableTotalHigh>
<unstableTotalNormal/>
<unstableTotalLow/>
<failedTotalAll/>
<failedTotalHigh>1</failedTotalHigh>
<failedTotalNormal/>
<failedTotalLow/>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern>**/checkstyle-result.xml</pattern>
</hudson.plugins.checkstyle.CheckStylePublisher>
</publishers>
</project>

View File

@ -0,0 +1,11 @@
publishers:
- checkstyle:
pattern: '**/checkstyle-result.xml'
healthy: 0
unHealthy: 100
healthThreshold: 'high'
thresholds:
unstable:
totalHigh: 10
failed:
totalHigh: 1

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.checkstyle.CheckStylePublisher>
<healthy/>
<unHealthy>100</unHealthy>
<thresholdLimit>high</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding>utf-8</defaultEncoding>
<canRunOnFailed>true</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll>90</unstableTotalAll>
<unstableTotalHigh>80</unstableTotalHigh>
<unstableTotalNormal>70</unstableTotalNormal>
<unstableTotalLow>60</unstableTotalLow>
<failedTotalAll>90</failedTotalAll>
<failedTotalHigh>80</failedTotalHigh>
<failedTotalNormal>70</failedTotalNormal>
<failedTotalLow>60</failedTotalLow>
</thresholds>
<shouldDetectModules>true</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern>**/checkstyle-result.xml</pattern>
</hudson.plugins.checkstyle.CheckStylePublisher>
</publishers>
</project>

View File

@ -0,0 +1,20 @@
publishers:
- checkstyle:
pattern: '**/checkstyle-result.xml'
canRunOnFailed: true
shouldDetectModules: true
healthy: 0
unHealthy: 100
healthThreshold: 'high'
thresholds:
unstable:
totalAll: 90
totalHigh: 80
totalNormal: 70
totalLow: 60
failed:
totalAll: 90
totalHigh: 80
totalNormal: 70
totalLow: 60
defaultEncoding: 'utf-8'

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.checkstyle.CheckStylePublisher>
<healthy/>
<unHealthy/>
<thresholdLimit>low</thresholdLimit>
<pluginName>[CHECKSTYLE] </pluginName>
<defaultEncoding/>
<canRunOnFailed>false</canRunOnFailed>
<useStableBuildAsReference>false</useStableBuildAsReference>
<useDeltaValues>false</useDeltaValues>
<thresholds>
<unstableTotalAll/>
<unstableTotalHigh/>
<unstableTotalNormal/>
<unstableTotalLow/>
<failedTotalAll/>
<failedTotalHigh/>
<failedTotalNormal/>
<failedTotalLow/>
</thresholds>
<shouldDetectModules>false</shouldDetectModules>
<dontComputeNew>true</dontComputeNew>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<pattern/>
</hudson.plugins.checkstyle.CheckStylePublisher>
</publishers>
</project>

View File

@ -0,0 +1,2 @@
publishers:
- checkstyle