Browse Source

Convert all inline publisher examples to tests

Convert all publisher examples to unit tests and use literalinclude to
have sphinx automatically inline the test file contents. Replace
mavendeploy test with more complete version from the code and include
some tests from files that were identical to the inline example.

Enable yaml syntax highlighting for existing examples for consistent
display of docstrings across the publishers module.

In turn fix any python 3 compatibility issues highlighted by the
additional tests executing previously unexercised code paths.

Change-Id: Ic0fd39dee0121c0c22a932fd455dccc5344893b2
tags/1.2.0
Darragh Bailey 5 years ago
parent
commit
09c0224fb2
60 changed files with 1192 additions and 385 deletions
  1. +163
    -380
      jenkins_jobs/modules/publishers.py
  2. +8
    -0
      tests/publishers/fixtures/aggregate-tests001.xml
  3. +3
    -0
      tests/publishers/fixtures/aggregate-tests001.yaml
  4. +6
    -0
      tests/publishers/fixtures/claim-build001.xml
  5. +2
    -0
      tests/publishers/fixtures/claim-build001.yaml
  6. +52
    -0
      tests/publishers/fixtures/cobertura001.xml
  7. +20
    -0
      tests/publishers/fixtures/cobertura001.yaml
  8. +10
    -0
      tests/publishers/fixtures/copy-to-master001.xml
  9. +7
    -0
      tests/publishers/fixtures/copy-to-master001.yaml
  10. +58
    -0
      tests/publishers/fixtures/coverage001.xml
  11. +2
    -0
      tests/publishers/fixtures/coverage001.yaml
  12. +34
    -0
      tests/publishers/fixtures/cppcheck001.xml
  13. +21
    -0
      tests/publishers/fixtures/cppcheck001.yaml
  14. +9
    -0
      tests/publishers/fixtures/fingerprint001.xml
  15. +4
    -0
      tests/publishers/fixtures/fingerprint001.yaml
  16. +8
    -0
      tests/publishers/fixtures/groovy-postbuild001.xml
  17. +2
    -0
      tests/publishers/fixtures/groovy-postbuild001.yaml
  18. +17
    -0
      tests/publishers/fixtures/html-publisher001.xml
  19. +7
    -0
      tests/publishers/fixtures/html-publisher001.yaml
  20. +24
    -0
      tests/publishers/fixtures/jabber001.xml
  21. +9
    -0
      tests/publishers/fixtures/jabber001.yaml
  22. +17
    -0
      tests/publishers/fixtures/jacoco001.xml
  23. +13
    -0
      tests/publishers/fixtures/jacoco001.yaml
  24. +6
    -0
      tests/publishers/fixtures/jira001.xml
  25. +2
    -0
      tests/publishers/fixtures/jira001.yaml
  26. +8
    -0
      tests/publishers/fixtures/join-trigger001.xml
  27. +5
    -0
      tests/publishers/fixtures/join-trigger001.yaml
  28. +10
    -0
      tests/publishers/fixtures/logparser001.xml
  29. +5
    -0
      tests/publishers/fixtures/logparser001.yaml
  30. +2
    -1
      tests/publishers/fixtures/maven-deploy001.xml
  31. +6
    -0
      tests/publishers/fixtures/maven-deploy001.yaml
  32. +0
    -4
      tests/publishers/fixtures/mavendeploy001.yaml
  33. +17
    -0
      tests/publishers/fixtures/performance001.xml
  34. +7
    -0
      tests/publishers/fixtures/performance001.yaml
  35. +17
    -0
      tests/publishers/fixtures/performance002.xml
  36. +7
    -0
      tests/publishers/fixtures/performance002.yaml
  37. +23
    -0
      tests/publishers/fixtures/performance003.xml
  38. +9
    -0
      tests/publishers/fixtures/performance003.yaml
  39. +51
    -0
      tests/publishers/fixtures/plot004.xml
  40. +30
    -0
      tests/publishers/fixtures/plot004.yaml
  41. +29
    -0
      tests/publishers/fixtures/post-tasks001.xml
  42. +13
    -0
      tests/publishers/fixtures/post-tasks001.yaml
  43. +19
    -0
      tests/publishers/fixtures/robot001.xml
  44. +13
    -0
      tests/publishers/fixtures/robot001.yaml
  45. +9
    -0
      tests/publishers/fixtures/sloccount001.xml
  46. +4
    -0
      tests/publishers/fixtures/sloccount001.yaml
  47. +17
    -0
      tests/publishers/fixtures/sonar001.xml
  48. +11
    -0
      tests/publishers/fixtures/sonar001.yaml
  49. +14
    -0
      tests/publishers/fixtures/tap001.xml
  50. +4
    -0
      tests/publishers/fixtures/tap001.yaml
  51. +12
    -0
      tests/publishers/fixtures/text-finder001.xml
  52. +7
    -0
      tests/publishers/fixtures/text-finder001.yaml
  53. +195
    -0
      tests/publishers/fixtures/violations001.xml
  54. +7
    -0
      tests/publishers/fixtures/violations001.yaml
  55. +55
    -0
      tests/publishers/fixtures/warnings001.xml
  56. +43
    -0
      tests/publishers/fixtures/warnings001.yaml
  57. +21
    -0
      tests/publishers/fixtures/workspace-cleanup001.xml
  58. +7
    -0
      tests/publishers/fixtures/workspace-cleanup001.yaml
  59. +8
    -0
      tests/publishers/fixtures/xml-summary001.xml
  60. +3
    -0
      tests/publishers/fixtures/xml-summary001.yaml

+ 163
- 380
jenkins_jobs/modules/publishers.py
File diff suppressed because it is too large
View File


+ 8
- 0
tests/publishers/fixtures/aggregate-tests001.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.tasks.test.AggregatedTestResultPublisher>
<includeFailedBuilds>true</includeFailedBuilds>
</hudson.tasks.test.AggregatedTestResultPublisher>
</publishers>
</project>

+ 3
- 0
tests/publishers/fixtures/aggregate-tests001.yaml View File

@@ -0,0 +1,3 @@
publishers:
- aggregate-tests:
include-failed-builds: true

+ 6
- 0
tests/publishers/fixtures/claim-build001.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.claim.ClaimPublisher/>
</publishers>
</project>

+ 2
- 0
tests/publishers/fixtures/claim-build001.yaml View File

@@ -0,0 +1,2 @@
publishers:
- claim-build

+ 52
- 0
tests/publishers/fixtures/cobertura001.xml View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.cobertura.CoberturaPublisher>
<coberturaReportFile>/reports/cobertura/coverage.xml</coberturaReportFile>
<onlyStable>true</onlyStable>
<failUnhealthy>true</failUnhealthy>
<failUnstable>true</failUnstable>
<autoUpdateHealth>true</autoUpdateHealth>
<autoUpdateStability>true</autoUpdateStability>
<zoomCoverageChart>true</zoomCoverageChart>
<failNoReports>true</failNoReports>
<healthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>FILES</hudson.plugins.cobertura.targets.CoverageMetric>
<int>10</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>50</int>
</entry>
</targets>
</healthyTarget>
<unhealthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>FILES</hudson.plugins.cobertura.targets.CoverageMetric>
<int>20</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>40</int>
</entry>
</targets>
</unhealthyTarget>
<failingTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>FILES</hudson.plugins.cobertura.targets.CoverageMetric>
<int>30</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>30</int>
</entry>
</targets>
</failingTarget>
<sourceEncoding>Big5</sourceEncoding>
</hudson.plugins.cobertura.CoberturaPublisher>
</publishers>
</project>

+ 20
- 0
tests/publishers/fixtures/cobertura001.yaml View File

@@ -0,0 +1,20 @@
publishers:
- cobertura:
report-file: "/reports/cobertura/coverage.xml"
only-stable: "true"
fail-no-reports: "true"
fail-unhealthy: "true"
fail-unstable: "true"
health-auto-update: "true"
stability-auto-update: "true"
zoom-coverage-chart: "true"
source-encoding: "Big5"
targets:
- files:
healthy: 10
unhealthy: 20
failing: 30
- method:
healthy: 50
unhealthy: 40
failing: 30

+ 10
- 0
tests/publishers/fixtures/copy-to-master001.xml View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier>
<includes>file1,file2*.txt</includes>
<excludes>file2bad.txt</excludes>
<destinationFolder/>
</com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/copy-to-master001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- copy-to-master:
includes:
- file1
- file2*.txt
excludes:
- file2bad.txt

+ 58
- 0
tests/publishers/fixtures/coverage001.xml View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.cobertura.CoberturaPublisher>
<coberturaReportFile>**/coverage.xml</coberturaReportFile>
<onlyStable>false</onlyStable>
<healthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>70</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>80</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>80</int>
</entry>
</targets>
</healthyTarget>
<unhealthyTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
</targets>
</unhealthyTarget>
<failingTarget>
<targets class="enum-map" enum-type="hudson.plugins.cobertura.targets.CoverageMetric">
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>CONDITIONAL</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>LINE</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
<entry>
<hudson.plugins.cobertura.targets.CoverageMetric>METHOD</hudson.plugins.cobertura.targets.CoverageMetric>
<int>0</int>
</entry>
</targets>
</failingTarget>
<sourceEncoding>ASCII</sourceEncoding>
</hudson.plugins.cobertura.CoberturaPublisher>
</publishers>
</project>

+ 2
- 0
tests/publishers/fixtures/coverage001.yaml View File

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

+ 34
- 0
tests/publishers/fixtures/cppcheck001.xml View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.cppcheck.CppcheckPublisher>
<cppcheckConfig>
<pattern>**/cppcheck.xml</pattern>
<ignoreBlankFiles>false</ignoreBlankFiles>
<configSeverityEvaluation>
<threshold>5</threshold>
<newThreshold>5</newThreshold>
<failureThreshold>7</failureThreshold>
<newFailureThreshold>3</newFailureThreshold>
<healthy/>
<unHealthy/>
<severityError>true</severityError>
<severityWarning>true</severityWarning>
<severityStyle>true</severityStyle>
<severityPerformance>true</severityPerformance>
<severityInformation>false</severityInformation>
</configSeverityEvaluation>
<configGraph>
<xSize>500</xSize>
<ySize>200</ySize>
<displayAllErrors>false</displayAllErrors>
<displayErrorSeverity>true</displayErrorSeverity>
<displayWarningSeverity>false</displayWarningSeverity>
<displayStyleSeverity>false</displayStyleSeverity>
<displayPerformanceSeverity>false</displayPerformanceSeverity>
<displayInformationSeverity>false</displayInformationSeverity>
</configGraph>
</cppcheckConfig>
</org.jenkinsci.plugins.cppcheck.CppcheckPublisher>
</publishers>
</project>

+ 21
- 0
tests/publishers/fixtures/cppcheck001.yaml View File

@@ -0,0 +1,21 @@
publishers:
- cppcheck:
pattern: "**/cppcheck.xml"
# the rest is optional
# build status (new) error count thresholds
thresholds:
unstable: 5
new-unstable: 5
failure: 7
new-failure: 3
# severities which count towards the threshold, default all true
severity:
error: true
warning: true
information: false
graph:
xysize: [500, 200]
# which errors to display, default only sum
display:
sum: false
error: true

+ 9
- 0
tests/publishers/fixtures/fingerprint001.xml View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.tasks.Fingerprinter>
<targets>builddir/test*.xml</targets>
<recordBuildArtifacts>false</recordBuildArtifacts>
</hudson.tasks.Fingerprinter>
</publishers>
</project>

+ 4
- 0
tests/publishers/fixtures/fingerprint001.yaml View File

@@ -0,0 +1,4 @@
publishers:
- fingerprint:
files: builddir/test*.xml
record-artifacts: false

+ 8
- 0
tests/publishers/fixtures/groovy-postbuild001.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
<groovyScript>manager.buildFailure()</groovyScript>
</org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder>
</publishers>
</project>

+ 2
- 0
tests/publishers/fixtures/groovy-postbuild001.yaml View File

@@ -0,0 +1,2 @@
publishers:
- groovy-postbuild: "manager.buildFailure()"

+ 17
- 0
tests/publishers/fixtures/html-publisher001.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<htmlpublisher.HtmlPublisher>
<reportTargets>
<htmlpublisher.HtmlPublisherTarget>
<reportName>some name</reportName>
<reportDir>path/</reportDir>
<reportFiles>index.html</reportFiles>
<keepAll>true</keepAll>
<allowMissing>true</allowMissing>
<wrapperName>htmlpublisher-wrapper.html</wrapperName>
</htmlpublisher.HtmlPublisherTarget>
</reportTargets>
</htmlpublisher.HtmlPublisher>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/html-publisher001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- html-publisher:
name: "some name"
dir: "path/"
files: "index.html"
keep-all: true
allow-missing: true

+ 24
- 0
tests/publishers/fixtures/jabber001.xml View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.jabber.im.transport.JabberPublisher>
<targets>
<hudson.plugins.im.GroupChatIMMessageTarget>
<name>foo-room@conference-2-fooserver.foo.com</name>
<notificationOnly>false</notificationOnly>
</hudson.plugins.im.GroupChatIMMessageTarget>
<hudson.plugins.im.DefaultIMMessageTarget>
<value>foo-user@conference-2-fooserver.foo.com</value>
</hudson.plugins.im.DefaultIMMessageTarget>
</targets>
<strategy>ALL</strategy>
<notifyOnBuildStart>true</notifyOnBuildStart>
<notifySuspects>false</notifySuspects>
<notifyCulprits>false</notifyCulprits>
<notifyFixers>false</notifyFixers>
<notifyUpstreamCommitters>false</notifyUpstreamCommitters>
<buildToChatNotifier class="hudson.plugins.im.build_notify.DefaultBuildToChatNotifier"/>
<matrixMultiplier>ONLY_CONFIGURATIONS</matrixMultiplier>
</hudson.plugins.jabber.im.transport.JabberPublisher>
</publishers>
</project>

+ 9
- 0
tests/publishers/fixtures/jabber001.yaml View File

@@ -0,0 +1,9 @@
publishers:
- jabber:
notify-on-build-start: true
group-targets:
- "foo-room@conference-2-fooserver.foo.com"
individual-targets:
- "foo-user@conference-2-fooserver.foo.com"
strategy: all
message: summary-scm

+ 17
- 0
tests/publishers/fixtures/jacoco001.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.jacoco.JacocoPublisher>
<execPattern>**/**.exec</execPattern>
<classPattern>**/classes</classPattern>
<sourcePattern>**/src/main/java</sourcePattern>
<changeBuildStatus/>
<inclusionPattern/>
<exclusionPattern/>
<maximumBranchCoverage>10</maximumBranchCoverage>
<minimumBranchCoverage>20</minimumBranchCoverage>
<maximumMethodCoverage>50</maximumMethodCoverage>
<minimumMethodCoverage>40</minimumMethodCoverage>
</hudson.plugins.jacoco.JacocoPublisher>
</publishers>
</project>

+ 13
- 0
tests/publishers/fixtures/jacoco001.yaml View File

@@ -0,0 +1,13 @@
publishers:
- jacoco:
exec-pattern: "**/**.exec"
class-pattern: "**/classes"
source-pattern: "**/src/main/java"
status-update: true
targets:
- branch:
healthy: 10
unhealthy: 20
- method:
healthy: 50
unhealthy: 40

+ 6
- 0
tests/publishers/fixtures/jira001.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.jira.JiraIssueUpdater/>
</publishers>
</project>

+ 2
- 0
tests/publishers/fixtures/jira001.yaml View File

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

+ 8
- 0
tests/publishers/fixtures/join-trigger001.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<join.JoinTrigger>
<joinProjects>project-one,project-two</joinProjects>
</join.JoinTrigger>
</publishers>
</project>

+ 5
- 0
tests/publishers/fixtures/join-trigger001.yaml View File

@@ -0,0 +1,5 @@
publishers:
- join-trigger:
projects:
- project-one
- project-two

+ 10
- 0
tests/publishers/fixtures/logparser001.xml View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.logparser.LogParserPublisher>
<unstableOnWarning>true</unstableOnWarning>
<failBuildOnError>true</failBuildOnError>
<parsingRulesPath>/path/to/parserules</parsingRulesPath>
</hudson.plugins.logparser.LogParserPublisher>
</publishers>
</project>

+ 5
- 0
tests/publishers/fixtures/logparser001.yaml View File

@@ -0,0 +1,5 @@
publishers:
- logparser:
parse-rules: "/path/to/parserules"
unstable-on-warning: true
fail-on-error: true

tests/publishers/fixtures/mavendeploy001.xml → tests/publishers/fixtures/maven-deploy001.xml View File

@@ -2,7 +2,8 @@
<project>
<publishers>
<hudson.maven.RedeployPublisher>
<url>file:///path/to/repo</url>
<id>example</id>
<url>http://repo.example.com/maven2/</url>
<uniqueVersion>true</uniqueVersion>
<evenIfUnstable>false</evenIfUnstable>
</hudson.maven.RedeployPublisher>

+ 6
- 0
tests/publishers/fixtures/maven-deploy001.yaml View File

@@ -0,0 +1,6 @@
publishers:
- maven-deploy:
id: example
url: http://repo.example.com/maven2/
unique-version: true
deploy-unstable: false

+ 0
- 4
tests/publishers/fixtures/mavendeploy001.yaml View File

@@ -1,4 +0,0 @@
publishers:
- maven-deploy:
url: file:///path/to/repo


+ 17
- 0
tests/publishers/fixtures/performance001.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.performance.PerformancePublisher>
<errorFailedThreshold>85</errorFailedThreshold>
<errorUnstableThreshold>-1</errorUnstableThreshold>
<parsers>
<hudson.plugins.performance.JMeterParser>
<glob>/special/file.jtl</glob>
</hudson.plugins.performance.JMeterParser>
<hudson.plugins.performance.JUnitParser>
<glob>/special/file.xml</glob>
</hudson.plugins.performance.JUnitParser>
</parsers>
</hudson.plugins.performance.PerformancePublisher>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/performance001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter: "/special/file.jtl"
- junit: "/special/file.xml"

+ 17
- 0
tests/publishers/fixtures/performance002.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.performance.PerformancePublisher>
<errorFailedThreshold>85</errorFailedThreshold>
<errorUnstableThreshold>-1</errorUnstableThreshold>
<parsers>
<hudson.plugins.performance.JMeterParser>
<glob>**/*.jtl</glob>
</hudson.plugins.performance.JMeterParser>
<hudson.plugins.performance.JUnitParser>
<glob>**/TEST-*.xml</glob>
</hudson.plugins.performance.JUnitParser>
</parsers>
</hudson.plugins.performance.PerformancePublisher>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/performance002.yaml View File

@@ -0,0 +1,7 @@
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter
- junit

+ 23
- 0
tests/publishers/fixtures/performance003.xml View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.performance.PerformancePublisher>
<errorFailedThreshold>85</errorFailedThreshold>
<errorUnstableThreshold>-1</errorUnstableThreshold>
<parsers>
<hudson.plugins.performance.JMeterParser>
<glob>/special/file.jtl</glob>
</hudson.plugins.performance.JMeterParser>
<hudson.plugins.performance.JUnitParser>
<glob>/special/file.xml</glob>
</hudson.plugins.performance.JUnitParser>
<hudson.plugins.performance.JMeterParser>
<glob>**/*.jtl</glob>
</hudson.plugins.performance.JMeterParser>
<hudson.plugins.performance.JUnitParser>
<glob>**/TEST-*.xml</glob>
</hudson.plugins.performance.JUnitParser>
</parsers>
</hudson.plugins.performance.PerformancePublisher>
</publishers>
</project>

+ 9
- 0
tests/publishers/fixtures/performance003.yaml View File

@@ -0,0 +1,9 @@
publishers:
- performance:
failed-threshold: 85
unstable-threshold: -1
report:
- jmeter: "/special/file.jtl"
- junit: "/special/file.xml"
- jmeter
- junit

+ 51
- 0
tests/publishers/fixtures/plot004.xml View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.plot.PlotPublisher>
<plots>
<hudson.plugins.plot.Plot>
<title>MyPlot</title>
<yaxis>Y</yaxis>
<csvFileName>myplot.csv</csvFileName>
<series>
<hudson.plugins.plot.PropertiesSeries>
<file>graph-me-second.properties</file>
<label>MyLabel</label>
<fileType>properties</fileType>
</hudson.plugins.plot.PropertiesSeries>
<hudson.plugins.plot.CSVSeries>
<file>graph-me-first.csv</file>
<inclusionFlag>OFF</inclusionFlag>
<exclusionValues/>
<url>http://srv1</url>
<displayTableFlag>false</displayTableFlag>
<fileType>csv</fileType>
</hudson.plugins.plot.CSVSeries>
</series>
<group>PlotGroup</group>
<useDescr>false</useDescr>
<numBuilds/>
<style>line</style>
</hudson.plugins.plot.Plot>
<hudson.plugins.plot.Plot>
<title>MyPlot2</title>
<yaxis>Y</yaxis>
<csvFileName>myplot2.csv</csvFileName>
<series>
<hudson.plugins.plot.XMLSeries>
<file>graph-me-third.xml</file>
<url>http://srv2</url>
<xpathString>/*</xpathString>
<nodeTypeString>NODE</nodeTypeString>
<fileType>xml</fileType>
</hudson.plugins.plot.XMLSeries>
</series>
<group>PlotGroup</group>
<useDescr>false</useDescr>
<numBuilds/>
<style>line</style>
</hudson.plugins.plot.Plot>
</plots>
</hudson.plugins.plot.PlotPublisher>
</publishers>
</project>

+ 30
- 0
tests/publishers/fixtures/plot004.yaml View File

@@ -0,0 +1,30 @@
publishers:
- plot:
- title: MyPlot
yaxis: Y
csv-file-name: myplot.csv
group: PlotGroup
num-builds: ''
style: line
use-description: false
series:
- file: graph-me-second.properties
label: MyLabel
format: properties
- file: graph-me-first.csv
url: 'http://srv1'
inclusion-flag: 'off'
display-table: true
format: csv
- title: MyPlot2
yaxis: Y
csv-file-name: myplot2.csv
group: PlotGroup
style: line
use-description: false
series:
- file: graph-me-third.xml
url: 'http://srv2'
format: xml
xpath-type: 'node'
xpath: '/*'

+ 29
- 0
tests/publishers/fixtures/post-tasks001.xml View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.postbuildtask.PostbuildTask>
<tasks>
<hudson.plugins.postbuildtask.TaskProperties>
<logTexts>
<hudson.plugins.postbuildtask.LogProperties>
<logText>line to match</logText>
<operator>AND</operator>
</hudson.plugins.postbuildtask.LogProperties>
<hudson.plugins.postbuildtask.LogProperties>
<logText>line to match</logText>
<operator>OR</operator>
</hudson.plugins.postbuildtask.LogProperties>
<hudson.plugins.postbuildtask.LogProperties>
<logText>line to match</logText>
<operator>AND</operator>
</hudson.plugins.postbuildtask.LogProperties>
</logTexts>
<EscalateStatus>true</EscalateStatus>
<RunIfJobSuccessful>true</RunIfJobSuccessful>
<script>echo &quot;Here goes the task script&quot;
</script>
</hudson.plugins.postbuildtask.TaskProperties>
</tasks>
</hudson.plugins.postbuildtask.PostbuildTask>
</publishers>
</project>

+ 13
- 0
tests/publishers/fixtures/post-tasks001.yaml View File

@@ -0,0 +1,13 @@
publishers:
- post-tasks:
- matches:
- log-text: line to match
operator: AND
- log-text: line to match
operator: OR
- log-text: line to match
operator: AND
escalate-status: true
run-if-job-successful: true
script: |
echo "Here goes the task script"

+ 19
- 0
tests/publishers/fixtures/robot001.xml View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.robot.RobotPublisher>
<outputPath>reports/robot</outputPath>
<logFileLink>report.html</logFileLink>
<reportFileName>custom-report.html</reportFileName>
<logFileName>custom-log.html</logFileName>
<outputFileName>custom-output.xml</outputFileName>
<passThreshold>80.0</passThreshold>
<unstableThreshold>60.0</unstableThreshold>
<onlyCritical>false</onlyCritical>
<otherFiles>
<string>extra-file1.html</string>
<string>extra-file2.txt</string>
</otherFiles>
</hudson.plugins.robot.RobotPublisher>
</publishers>
</project>

+ 13
- 0
tests/publishers/fixtures/robot001.yaml View File

@@ -0,0 +1,13 @@
publishers:
- robot:
output-path: reports/robot
log-file-link: report.html
report-html: custom-report.html
log-html: custom-log.html
output-xml: custom-output.xml
pass-threshold: 80.0
unstable-threshold: 60.0
only-critical: false
other-files:
- extra-file1.html
- extra-file2.txt

+ 9
- 0
tests/publishers/fixtures/sloccount001.xml View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.sloccount.SloccountPublisher>
<pattern>sloccount.sc</pattern>
<encoding>latin-1</encoding>
</hudson.plugins.sloccount.SloccountPublisher>
</publishers>
</project>

+ 4
- 0
tests/publishers/fixtures/sloccount001.yaml View File

@@ -0,0 +1,4 @@
publishers:
- sloccount:
report-files: sloccount.sc
charset: latin-1

+ 17
- 0
tests/publishers/fixtures/sonar001.xml View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.sonar.SonarPublisher>
<jdk>MyJdk</jdk>
<branch>myBranch</branch>
<language>java</language>
<mavenOpts>-DskipTests</mavenOpts>
<jobAdditionalProperties>-DsonarHostURL=http://example.com/</jobAdditionalProperties>
<triggers>
<skipScmCause>true</skipScmCause>
<skipUpstreamCause>true</skipUpstreamCause>
<envVar>SKIP_SONAR</envVar>
</triggers>
</hudson.plugins.sonar.SonarPublisher>
</publishers>
</project>

+ 11
- 0
tests/publishers/fixtures/sonar001.yaml View File

@@ -0,0 +1,11 @@
publishers:
- sonar:
jdk: MyJdk
branch: myBranch
language: java
maven-opts: -DskipTests
additional-properties: -DsonarHostURL=http://example.com/
skip-global-triggers:
skip-when-scm-change: true
skip-when-upstream-build: true
skip-when-envvar-defined: SKIP_SONAR

+ 14
- 0
tests/publishers/fixtures/tap001.xml View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.tap4j.plugin.TapPublisher>
<testResults>puiparts.tap</testResults>
<failIfNoResults>false</failIfNoResults>
<failedTestsMarkBuildAsFailure>false</failedTestsMarkBuildAsFailure>
<outputTapToConsole>true</outputTapToConsole>
<enableSubtests>true</enableSubtests>
<discardOldReports>false</discardOldReports>
<todoIsFailure>false</todoIsFailure>
</org.tap4j.plugin.TapPublisher>
</publishers>
</project>

+ 4
- 0
tests/publishers/fixtures/tap001.yaml View File

@@ -0,0 +1,4 @@
publishers:
- tap:
results: puiparts.tap
todo-is-failure: false

+ 12
- 0
tests/publishers/fixtures/text-finder001.xml View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher>
<fileSet>file.txt</fileSet>
<regexp>some string</regexp>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>false</unstableIfFound>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/text-finder001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- text-finder:
regexp: "some string"
fileset: "file.txt"
also-check-console-output: true
succeed-if-found: false
unstable-if-found: false

+ 195
- 0
tests/publishers/fixtures/violations001.xml View File

@@ -0,0 +1,195 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.violations.ViolationsPublisher>
<config>
<suppressions class="tree-set">
<no-comparator/>
</suppressions>
<typeConfigs>
<no-comparator/>
<entry>
<string>checkstyle</string>
<hudson.plugins.violations.TypeConfig>
<type>checkstyle</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>codenarc</string>
<hudson.plugins.violations.TypeConfig>
<type>codenarc</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>cpd</string>
<hudson.plugins.violations.TypeConfig>
<type>cpd</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>cpplint</string>
<hudson.plugins.violations.TypeConfig>
<type>cpplint</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>csslint</string>
<hudson.plugins.violations.TypeConfig>
<type>csslint</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>findbugs</string>
<hudson.plugins.violations.TypeConfig>
<type>findbugs</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>fxcop</string>
<hudson.plugins.violations.TypeConfig>
<type>fxcop</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>gendarme</string>
<hudson.plugins.violations.TypeConfig>
<type>gendarme</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>jcreport</string>
<hudson.plugins.violations.TypeConfig>
<type>jcreport</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>jslint</string>
<hudson.plugins.violations.TypeConfig>
<type>jslint</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>pep8</string>
<hudson.plugins.violations.TypeConfig>
<type>pep8</type>
<min>0</min>
<max>1</max>
<unstable>1</unstable>
<usePattern>false</usePattern>
<pattern>**/pep8.txt</pattern>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>perlcritic</string>
<hudson.plugins.violations.TypeConfig>
<type>perlcritic</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>pmd</string>
<hudson.plugins.violations.TypeConfig>
<type>pmd</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>pylint</string>
<hudson.plugins.violations.TypeConfig>
<type>pylint</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>simian</string>
<hudson.plugins.violations.TypeConfig>
<type>simian</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
<entry>
<string>stylecop</string>
<hudson.plugins.violations.TypeConfig>
<type>stylecop</type>
<min>10</min>
<max>999</max>
<unstable>999</unstable>
<usePattern>false</usePattern>
<pattern/>
</hudson.plugins.violations.TypeConfig>
</entry>
</typeConfigs>
<limit>100</limit>
<sourcePathPattern/>
<fauxProjectPath/>
<encoding>default</encoding>
</config>
</hudson.plugins.violations.ViolationsPublisher>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/violations001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- violations:
pep8:
min: 0
max: 1
unstable: 1
pattern: '**/pep8.txt'

+ 55
- 0
tests/publishers/fixtures/warnings001.xml View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.warnings.WarningsPublisher>
<consoleParsers>
<hudson.plugins.warnings.ConsoleParser>
<parserName>FxCop</parserName>
</hudson.plugins.warnings.ConsoleParser>
<hudson.plugins.warnings.ConsoleParser>
<parserName>CodeAnalysis</parserName>
</hudson.plugins.warnings.ConsoleParser>
</consoleParsers>
<parserConfigurations>
<hudson.plugins.warnings.ParserConfiguration>
<pattern>**/*.out</pattern>
<parserName>AcuCobol Compiler</parserName>
</hudson.plugins.warnings.ParserConfiguration>
<hudson.plugins.warnings.ParserConfiguration>
<pattern>**/*.warnings</pattern>
<parserName>FxCop</parserName>
</hudson.plugins.warnings.ParserConfiguration>
</parserConfigurations>
<includePattern>[a-zA-Z]\.java,[a-zA-Z]\.cpp</includePattern>
<excludePattern>[a-zA-Z]\.html,[a-zA-Z]\.js</excludePattern>
<canRunOnFailed>true</canRunOnFailed>
<shouldDetectModules>true</shouldDetectModules>
<doNotResolveRelativePaths>false</doNotResolveRelativePaths>
<healthy>50</healthy>
<unHealthy>25</unHealthy>
<thresholdLimit>normal</thresholdLimit>
<thresholds>
<unstableTotalAll>90</unstableTotalAll>
<unstableTotalHigh>90</unstableTotalHigh>
<unstableTotalNormal>40</unstableTotalNormal>
<unstableTotalLow>30</unstableTotalLow>
<failedTotalAll>100</failedTotalAll>
<failedTotalHigh>100</failedTotalHigh>
<failedTotalNormal>50</failedTotalNormal>
<failedTotalLow>40</failedTotalLow>
<unstableNewAll>100</unstableNewAll>
<unstableNewHigh>50</unstableNewHigh>
<unstableNewNormal>30</unstableNewNormal>
<unstableNewLow>10</unstableNewLow>
<failedNewAll>100</failedNewAll>
<failedNewHigh>60</failedNewHigh>
<failedNewNormal>50</failedNewNormal>
<failedNewLow>40</failedNewLow>
</thresholds>
<dontComputeNew>false</dontComputeNew>
<useDeltaValues>true</useDeltaValues>
<useStableBuildAsReference>true</useStableBuildAsReference>
<defaultEncoding>ISO-8859-9</defaultEncoding>
</hudson.plugins.warnings.WarningsPublisher>
</publishers>
</project>

+ 43
- 0
tests/publishers/fixtures/warnings001.yaml View File

@@ -0,0 +1,43 @@
publishers:
- warnings:
console-log-parsers:
- FxCop
- CodeAnalysis
workspace-file-scanners:
- file-pattern: '**/*.out'
scanner: 'AcuCobol Compiler'
- file-pattern: '**/*.warnings'
scanner: FxCop
files-to-include: '[a-zA-Z]\.java,[a-zA-Z]\.cpp'
files-to-ignore: '[a-zA-Z]\.html,[a-zA-Z]\.js'
run-always: true
detect-modules: true
resolve-relative-paths: true
health-threshold-high: 50
health-threshold-low: 25
health-priorities: high-and-normal
total-thresholds:
unstable:
total-all: 90
total-high: 90
total-normal: 40
total-low: 30
failed:
total-all: 100
total-high: 100
total-normal: 50
total-low: 40
new-thresholds:
unstable:
new-all: 100
new-high: 50
new-normal: 30
new-low: 10
failed:
new-all: 100
new-high: 60
new-normal: 50
new-low: 40
use-delta-for-new-warnings: true
only-use-stable-builds-as-reference: true
default-encoding: ISO-8859-9

+ 21
- 0
tests/publishers/fixtures/workspace-cleanup001.xml View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.ws__cleanup.WsCleanup plugin="ws-cleanup@0.14">
<patterns>
<hudson.plugins.ws__cleanup.Pattern>
<pattern>*.zip</pattern>
<type>INCLUDE</type>
</hudson.plugins.ws__cleanup.Pattern>
</patterns>
<deleteDirs>false</deleteDirs>
<cleanupMatrixParent>false</cleanupMatrixParent>
<cleanWhenSuccess>true</cleanWhenSuccess>
<cleanWhenUnstable>true</cleanWhenUnstable>
<cleanWhenFailure>true</cleanWhenFailure>
<cleanWhenNotBuilt>false</cleanWhenNotBuilt>
<cleanWhenAborted>true</cleanWhenAborted>
<notFailBuild>true</notFailBuild>
</hudson.plugins.ws__cleanup.WsCleanup>
</publishers>
</project>

+ 7
- 0
tests/publishers/fixtures/workspace-cleanup001.yaml View File

@@ -0,0 +1,7 @@
publishers:
- workspace-cleanup:
include:
- "*.zip"
clean-if:
- success: true
- not-built: false

+ 8
- 0
tests/publishers/fixtures/xml-summary001.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.plugins.summary__report.ACIPluginPublisher>
<name>*_summary_report.xml</name>
</hudson.plugins.summary__report.ACIPluginPublisher>
</publishers>
</project>

+ 3
- 0
tests/publishers/fixtures/xml-summary001.yaml View File

@@ -0,0 +1,3 @@
publishers:
- xml-summary:
files: '*_summary_report.xml'

Loading…
Cancel
Save