From 09c0224fb2e3f4cbe568716f2becd035e07954ed Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Fri, 20 Mar 2015 01:03:00 +0000 Subject: [PATCH] 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 --- jenkins_jobs/modules/publishers.py | 525 +++++------------- .../fixtures/aggregate-tests001.xml | 8 + .../fixtures/aggregate-tests001.yaml | 3 + tests/publishers/fixtures/claim-build001.xml | 6 + tests/publishers/fixtures/claim-build001.yaml | 2 + tests/publishers/fixtures/cobertura001.xml | 52 ++ tests/publishers/fixtures/cobertura001.yaml | 20 + .../publishers/fixtures/copy-to-master001.xml | 10 + .../fixtures/copy-to-master001.yaml | 7 + tests/publishers/fixtures/coverage001.xml | 58 ++ tests/publishers/fixtures/coverage001.yaml | 2 + tests/publishers/fixtures/cppcheck001.xml | 34 ++ tests/publishers/fixtures/cppcheck001.yaml | 21 + tests/publishers/fixtures/fingerprint001.xml | 9 + tests/publishers/fixtures/fingerprint001.yaml | 4 + .../fixtures/groovy-postbuild001.xml | 8 + .../fixtures/groovy-postbuild001.yaml | 2 + .../publishers/fixtures/html-publisher001.xml | 17 + .../fixtures/html-publisher001.yaml | 7 + tests/publishers/fixtures/jabber001.xml | 24 + tests/publishers/fixtures/jabber001.yaml | 9 + tests/publishers/fixtures/jacoco001.xml | 17 + tests/publishers/fixtures/jacoco001.yaml | 13 + tests/publishers/fixtures/jira001.xml | 6 + tests/publishers/fixtures/jira001.yaml | 2 + tests/publishers/fixtures/join-trigger001.xml | 8 + .../publishers/fixtures/join-trigger001.yaml | 5 + tests/publishers/fixtures/logparser001.xml | 10 + tests/publishers/fixtures/logparser001.yaml | 5 + ...mavendeploy001.xml => maven-deploy001.xml} | 3 +- .../publishers/fixtures/maven-deploy001.yaml | 6 + tests/publishers/fixtures/mavendeploy001.yaml | 4 - tests/publishers/fixtures/performance001.xml | 17 + tests/publishers/fixtures/performance001.yaml | 7 + tests/publishers/fixtures/performance002.xml | 17 + tests/publishers/fixtures/performance002.yaml | 7 + tests/publishers/fixtures/performance003.xml | 23 + tests/publishers/fixtures/performance003.yaml | 9 + tests/publishers/fixtures/plot004.xml | 51 ++ tests/publishers/fixtures/plot004.yaml | 30 + tests/publishers/fixtures/post-tasks001.xml | 29 + tests/publishers/fixtures/post-tasks001.yaml | 13 + tests/publishers/fixtures/robot001.xml | 19 + tests/publishers/fixtures/robot001.yaml | 13 + tests/publishers/fixtures/sloccount001.xml | 9 + tests/publishers/fixtures/sloccount001.yaml | 4 + tests/publishers/fixtures/sonar001.xml | 17 + tests/publishers/fixtures/sonar001.yaml | 11 + tests/publishers/fixtures/tap001.xml | 14 + tests/publishers/fixtures/tap001.yaml | 4 + tests/publishers/fixtures/text-finder001.xml | 12 + tests/publishers/fixtures/text-finder001.yaml | 7 + tests/publishers/fixtures/violations001.xml | 195 +++++++ tests/publishers/fixtures/violations001.yaml | 7 + tests/publishers/fixtures/warnings001.xml | 55 ++ tests/publishers/fixtures/warnings001.yaml | 43 ++ .../fixtures/workspace-cleanup001.xml | 21 + .../fixtures/workspace-cleanup001.yaml | 7 + tests/publishers/fixtures/xml-summary001.xml | 8 + tests/publishers/fixtures/xml-summary001.yaml | 3 + 60 files changed, 1183 insertions(+), 376 deletions(-) create mode 100644 tests/publishers/fixtures/aggregate-tests001.xml create mode 100644 tests/publishers/fixtures/aggregate-tests001.yaml create mode 100644 tests/publishers/fixtures/claim-build001.xml create mode 100644 tests/publishers/fixtures/claim-build001.yaml create mode 100644 tests/publishers/fixtures/cobertura001.xml create mode 100644 tests/publishers/fixtures/cobertura001.yaml create mode 100644 tests/publishers/fixtures/copy-to-master001.xml create mode 100644 tests/publishers/fixtures/copy-to-master001.yaml create mode 100644 tests/publishers/fixtures/coverage001.xml create mode 100644 tests/publishers/fixtures/coverage001.yaml create mode 100644 tests/publishers/fixtures/cppcheck001.xml create mode 100644 tests/publishers/fixtures/cppcheck001.yaml create mode 100644 tests/publishers/fixtures/fingerprint001.xml create mode 100644 tests/publishers/fixtures/fingerprint001.yaml create mode 100644 tests/publishers/fixtures/groovy-postbuild001.xml create mode 100644 tests/publishers/fixtures/groovy-postbuild001.yaml create mode 100644 tests/publishers/fixtures/html-publisher001.xml create mode 100644 tests/publishers/fixtures/html-publisher001.yaml create mode 100644 tests/publishers/fixtures/jabber001.xml create mode 100644 tests/publishers/fixtures/jabber001.yaml create mode 100644 tests/publishers/fixtures/jacoco001.xml create mode 100644 tests/publishers/fixtures/jacoco001.yaml create mode 100644 tests/publishers/fixtures/jira001.xml create mode 100644 tests/publishers/fixtures/jira001.yaml create mode 100644 tests/publishers/fixtures/join-trigger001.xml create mode 100644 tests/publishers/fixtures/join-trigger001.yaml create mode 100644 tests/publishers/fixtures/logparser001.xml create mode 100644 tests/publishers/fixtures/logparser001.yaml rename tests/publishers/fixtures/{mavendeploy001.xml => maven-deploy001.xml} (77%) create mode 100644 tests/publishers/fixtures/maven-deploy001.yaml delete mode 100644 tests/publishers/fixtures/mavendeploy001.yaml create mode 100644 tests/publishers/fixtures/performance001.xml create mode 100644 tests/publishers/fixtures/performance001.yaml create mode 100644 tests/publishers/fixtures/performance002.xml create mode 100644 tests/publishers/fixtures/performance002.yaml create mode 100644 tests/publishers/fixtures/performance003.xml create mode 100644 tests/publishers/fixtures/performance003.yaml create mode 100644 tests/publishers/fixtures/plot004.xml create mode 100644 tests/publishers/fixtures/plot004.yaml create mode 100644 tests/publishers/fixtures/post-tasks001.xml create mode 100644 tests/publishers/fixtures/post-tasks001.yaml create mode 100644 tests/publishers/fixtures/robot001.xml create mode 100644 tests/publishers/fixtures/robot001.yaml create mode 100644 tests/publishers/fixtures/sloccount001.xml create mode 100644 tests/publishers/fixtures/sloccount001.yaml create mode 100644 tests/publishers/fixtures/sonar001.xml create mode 100644 tests/publishers/fixtures/sonar001.yaml create mode 100644 tests/publishers/fixtures/tap001.xml create mode 100644 tests/publishers/fixtures/tap001.yaml create mode 100644 tests/publishers/fixtures/text-finder001.xml create mode 100644 tests/publishers/fixtures/text-finder001.yaml create mode 100644 tests/publishers/fixtures/violations001.xml create mode 100644 tests/publishers/fixtures/violations001.yaml create mode 100644 tests/publishers/fixtures/warnings001.xml create mode 100644 tests/publishers/fixtures/warnings001.yaml create mode 100644 tests/publishers/fixtures/workspace-cleanup001.xml create mode 100644 tests/publishers/fixtures/workspace-cleanup001.yaml create mode 100644 tests/publishers/fixtures/xml-summary001.xml create mode 100644 tests/publishers/fixtures/xml-summary001.yaml diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 7e0def3fb..2d98f97de 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -52,7 +52,7 @@ def archive(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/archive001.yaml - + :language: yaml """ logger = logging.getLogger("%s:archive" % __name__) archiver = XML.SubElement(xml_parent, 'hudson.tasks.ArtifactArchiver') @@ -92,7 +92,7 @@ def blame_upstream(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/blame001.yaml - + :language: yaml """ XML.SubElement(xml_parent, @@ -117,7 +117,7 @@ def campfire(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/campfire001.yaml - + :language: yaml """ root = XML.SubElement(xml_parent, @@ -153,6 +153,7 @@ def emotional_jenkins(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/emotional-jenkins.yaml + :language: yaml """ XML.SubElement(xml_parent, 'org.jenkinsci.plugins.emotional__jenkins.' @@ -194,8 +195,8 @@ def trigger_parameterized_builds(parser, xml_parent, data): Example: .. literalinclude:: - /../../tests/publishers/fixtures/trigger_parameterized_builds001.yaml - + /../../tests/publishers/fixtures/trigger_parameterized_builds001.yaml + :language: yaml """ tbuilder = XML.SubElement(xml_parent, 'hudson.plugins.parameterizedtrigger.' @@ -294,6 +295,7 @@ def trigger(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/trigger_success.yaml + :language: yaml """ tconfig = XML.SubElement(xml_parent, 'hudson.tasks.BuildTrigger') childProjects = XML.SubElement(tconfig, 'childProjects') @@ -332,13 +334,14 @@ def clone_workspace(parser, xml_parent, data): Minimal example: .. literalinclude:: - /../../tests/publishers/fixtures/clone-workspace001.yaml + /../../tests/publishers/fixtures/clone-workspace001.yaml + :language: yaml Full example: .. literalinclude:: - /../../tests/publishers/fixtures/clone-workspace002.yaml - + /../../tests/publishers/fixtures/clone-workspace002.yaml + :language: yaml """ cloneworkspace = XML.SubElement( @@ -417,12 +420,13 @@ def cloverphp(parser, xml_parent, data): Minimal example: - .. literalinclude:: /../../tests/publishers/fixtures/cloverphp001.yaml + .. literalinclude:: /../../tests/publishers/fixtures/cloverphp001.yaml + :language: yaml Full example: - .. literalinclude:: /../../tests/publishers/fixtures/cloverphp002.yaml - + .. literalinclude:: /../../tests/publishers/fixtures/cloverphp002.yaml + :language: yaml """ cloverphp = XML.SubElement( xml_parent, @@ -496,10 +500,10 @@ def coverage(parser, xml_parent, data): Requires the Jenkins :jenkins-wiki:`Cobertura Coverage Plugin `. - Example:: + Example: - publishers: - - coverage + .. literalinclude:: /../../tests/publishers/fixtures/coverage001.yaml + :language: yaml """ logger = logging.getLogger(__name__) logger.warn("Coverage function is deprecated. Switch to cobertura.") @@ -589,30 +593,10 @@ def cobertura(parser, xml_parent, data): * **unhealthy** (`int`): Unhealthy threshold (default 0) * **failing** (`int`): Failing threshold (default 0) - Example:: - - 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 - + Example: + .. literalinclude:: /../../tests/publishers/fixtures/cobertura001.yaml + :language: yaml """ cobertura = XML.SubElement(xml_parent, 'hudson.plugins.cobertura.CoberturaPublisher') @@ -637,7 +621,7 @@ def cobertura(parser, xml_parent, data): 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: - item_name = item.keys()[0] + item_name = next(iter(item.keys())) item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, @@ -649,7 +633,7 @@ def cobertura(parser, xml_parent, data): 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: - item_name = item.keys()[0] + item_name = next(iter(item.keys())) item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.' @@ -661,7 +645,7 @@ def cobertura(parser, xml_parent, data): 'class': 'enum-map', 'enum-type': 'hudson.plugins.cobertura.targets.CoverageMetric'}) for item in data['targets']: - item_name = item.keys()[0] + item_name = next(iter(item.keys())) item_values = item.get(item_name, 0) entry = XML.SubElement(targets, 'entry') XML.SubElement(entry, 'hudson.plugins.cobertura.targets.' @@ -696,22 +680,10 @@ def jacoco(parser, xml_parent, data): * **healthy** (`int`): Healthy threshold (default 0) * **unhealthy** (`int`): Unhealthy threshold (default 0) - Example:: - - 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 + Example: + .. literalinclude:: /../../tests/publishers/fixtures/jacoco001.yaml + :language: yaml """ jacoco = XML.SubElement(xml_parent, @@ -737,7 +709,7 @@ def jacoco(parser, xml_parent, data): 'class'] for item in data['targets']: - item_name = item.keys()[0] + item_name = next(iter(item.keys())) if item_name not in itemsList: raise JenkinsJobsException("item entered is not valid must be " "one of: %s" % ",".join(itemsList)) @@ -812,11 +784,12 @@ def junit(parser, xml_parent, data): Minimal example using defaults: .. literalinclude:: /../../tests/publishers/fixtures/junit001.yaml + :language: yaml Full example: .. literalinclude:: /../../tests/publishers/fixtures/junit002.yaml - + :language: yaml """ junitresult = XML.SubElement(xml_parent, 'hudson.tasks.junit.JUnitResultArchiver') @@ -1015,15 +988,10 @@ def violations(parser, xml_parent, data): gendarme, jcreport, jslint, pep8, perlcritic, pmd, pylint, simian, stylecop - Example:: + Example: - publishers: - - violations: - pep8: - min: 0 - max: 1 - unstable: 1 - pattern: '**/pep8.txt' + .. literalinclude:: /../../tests/publishers/fixtures/violations001.yaml + :language: yaml """ violations = XML.SubElement(xml_parent, 'hudson.plugins.violations.' @@ -1115,11 +1083,12 @@ def checkstyle(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/checkstyle004.yaml + :language: yaml Full example: .. literalinclude:: /../../tests/publishers/fixtures/checkstyle006.yaml - + :language: yaml """ def convert_settings(lookup, data): """Helper to convert settings from one key to another @@ -1198,7 +1167,7 @@ def scp(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/scp001.yaml - + :language: yaml """ site = data['site'] scp = XML.SubElement(xml_parent, @@ -1252,7 +1221,6 @@ def ssh(parser, xml_parent, data): .. literalinclude:: /../../tests/publishers/fixtures/ssh001.yaml :language: yaml - """ console_prefix = 'SSH: ' plugin_tag = 'jenkins.plugins.publish__over__ssh.BapSshPublisherPlugin' @@ -1284,6 +1252,7 @@ def pipeline(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/pipeline002.yaml + :language: yaml You can build pipeline jobs that are re-usable in different pipelines by @@ -1352,10 +1321,10 @@ def claim_build(parser, xml_parent, data): Claim build failures Requires the Jenkins :jenkins-wiki:`Claim Plugin `. - Example:: + Example: - publishers: - - claim-build + .. literalinclude:: /../../tests/publishers/fixtures/claim-build001.yaml + :language: yaml """ XML.SubElement(xml_parent, 'hudson.plugins.claim.ClaimPublisher') @@ -1443,6 +1412,7 @@ def email_ext(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/email-ext001.yaml + :language: yaml """ emailext = XML.SubElement(xml_parent, @@ -1529,12 +1499,10 @@ def fingerprint(parser, xml_parent, data): :arg bool record-artifacts: fingerprint all archived artifacts (default false) - Example:: + Example: - publishers: - - fingerprint: - files: builddir/test*.xml - record-artifacts: false + .. literalinclude:: /../../tests/publishers/fixtures/fingerprint001.yaml + :language: yaml """ finger = XML.SubElement(xml_parent, 'hudson.tasks.Fingerprinter') XML.SubElement(finger, 'targets').text = data.get('files', '') @@ -1548,11 +1516,11 @@ def aggregate_tests(parser, xml_parent, data): :arg bool include-failed-builds: whether to include failed builds - Example:: + Example: - publishers: - - aggregate-tests: - include-failed-builds: true + .. literalinclude:: + /../../tests/publishers/fixtures/aggregate-tests001.yaml + :language: yaml """ agg = XML.SubElement(xml_parent, 'hudson.tasks.test.AggregatedTestResultPublisher') @@ -1588,29 +1556,10 @@ def cppcheck(parser, xml_parent, data): for more optional parameters see the example - Example:: + Example: - 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 + .. literalinclude:: /../../tests/publishers/fixtures/cppcheck001.yaml + :language: yaml """ cppextbase = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.cppcheck.' @@ -1672,13 +1621,10 @@ def logparser(parser, xml_parent, data): :arg bool unstable-on-warning: mark build unstable on warning :arg bool fail-on-error: mark build failed on error - Example:: + Example: - publishers: - - logparser: - parse-rules: "/path/to/parserules" - unstable-on-warning: true - fail-on-error: true + .. literalinclude:: /../../tests/publishers/fixtures/logparser001.yaml + :language: yaml """ clog = XML.SubElement(xml_parent, @@ -1703,15 +1649,11 @@ def copy_to_master(parser, xml_parent, data): If left blank they will be copied into the workspace of the current job - Example:: + Example: - publishers: - - copy-to-master: - includes: - - file1 - - file2*.txt - excludes: - - file2bad.txt + .. literalinclude:: + /../../tests/publishers/fixtures/copy-to-master001.yaml + :language: yaml """ p = 'com.michelin.cio.hudson.plugins.copytoslave.CopyToMasterNotifier' cm = XML.SubElement(xml_parent, p) @@ -1731,10 +1673,10 @@ def jira(parser, xml_parent, data): Update relevant JIRA issues Requires the Jenkins :jenkins-wiki:`JIRA Plugin `. - Example:: + Example: - publishers: - - jira + .. literalinclude:: /../../tests/publishers/fixtures/jira001.yaml + :language: yaml """ XML.SubElement(xml_parent, 'hudson.plugins.jira.JiraIssueUpdater') @@ -1747,11 +1689,11 @@ def groovy_postbuild(parser, xml_parent, data): :Parameter: the groovy script to execute - Example:: - - publishers: - - groovy-postbuild: "manager.buildFailure()" + Example: + .. literalinclude:: + /../../tests/publishers/fixtures/groovy-postbuild001.yaml + :language: yaml """ root_tag = 'org.jvnet.hudson.plugins.groovypostbuild.'\ 'GroovyPostbuildRecorder' @@ -1855,6 +1797,7 @@ def cigame(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/cigame.yaml + :language: yaml """ XML.SubElement(xml_parent, 'hudson.plugins.cigame.GamePublisher') @@ -1881,19 +1824,10 @@ def sonar(parser, xml_parent, data): This publisher supports the post-build action exposed by the Jenkins Sonar Plugin, which is triggering a Sonar Analysis with Maven. - Example:: + Example: - 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 + .. literalinclude:: /../../tests/publishers/fixtures/sonar001.yaml + :language: yaml """ sonar = XML.SubElement(xml_parent, 'hudson.plugins.sonar.SonarPublisher') if 'jdk' in data: @@ -1931,33 +1865,16 @@ def performance(parser, xml_parent, data): :(jmeter or junit): (`dict` or `str`): Specify a custom report file (optional; jmeter default \**/*.jtl, junit default **/TEST-\*.xml) - Examples:: + Examples: - publishers: - - performance: - failed-threshold: 85 - unstable-threshold: -1 - report: - - jmeter: "/special/file.jtl" - - junit: "/special/file.xml" + .. literalinclude:: /../../tests/publishers/fixtures/performance001.yaml + :language: yaml - publishers: - - performance: - failed-threshold: 85 - unstable-threshold: -1 - report: - - jmeter - - junit + .. literalinclude:: /../../tests/publishers/fixtures/performance002.yaml + :language: yaml - publishers: - - performance: - failed-threshold: 85 - unstable-threshold: -1 - report: - - jmeter: "/special/file.jtl" - - junit: "/special/file.xml" - - jmeter - - junit + .. literalinclude:: /../../tests/publishers/fixtures/performance003.yaml + :language: yaml """ logger = logging.getLogger(__name__) @@ -1970,7 +1887,7 @@ def performance(parser, xml_parent, data): parsers = XML.SubElement(perf, 'parsers') for item in data['report']: if isinstance(item, dict): - item_name = item.keys()[0] + item_name = next(iter(item.keys())) item_values = item.get(item_name, None) if item_name == 'jmeter': jmhold = XML.SubElement(parsers, 'hudson.plugins.performance.' @@ -2005,13 +1922,10 @@ def join_trigger(parser, xml_parent, data): :arg list projects: list of projects to trigger - Example:: + Example: - publishers: - - join-trigger: - projects: - - project-one - - project-two + .. literalinclude:: /../../tests/publishers/fixtures/join-trigger001.yaml + :language: yaml """ jointrigger = XML.SubElement(xml_parent, 'join.JoinTrigger') @@ -2054,17 +1968,10 @@ def jabber(parser, xml_parent, data): * **summary-build** -- Summary and build parameters * **summary-scm-fail** -- Summary, SCM changes, and failed tests - Example:: + Example: - 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 + .. literalinclude:: /../../tests/publishers/fixtures/jabber001.yaml + :language: yaml """ j = XML.SubElement(xml_parent, 'hudson.plugins.jabber.im.transport.' 'JabberPublisher') @@ -2136,15 +2043,11 @@ def workspace_cleanup(parser, xml_parent, data): :arg bool fail-build: Fail the build if the cleanup fails (default: true) :arg bool clean-parent: Cleanup matrix parent workspace (default: false) - Example:: + Example: - publishers: - - workspace-cleanup: - include: - - "*.zip" - clean-if: - - success: true - - not-built: false + .. literalinclude:: + /../../tests/publishers/fixtures/workspace-cleanup001.yaml + :language: yaml """ p = XML.SubElement(xml_parent, @@ -2168,14 +2071,16 @@ def workspace_cleanup(parser, xml_parent, data): XML.SubElement(p, 'cleanupMatrixParent').text = \ str(data.get("clean-parent", False)).lower() - mask = {'success': 'cleanWhenSuccess', 'unstable': 'cleanWhenUnstable', - 'failure': 'cleanWhenFailure', 'not-built': 'cleanWhenNotBuilt', - 'aborted': 'cleanWhenAborted'} + mask = [('success', 'cleanWhenSuccess'), + ('unstable', 'cleanWhenUnstable'), + ('failure', 'cleanWhenFailure'), + ('not-built', 'cleanWhenNotBuilt'), + ('aborted', 'cleanWhenAborted')] clean = data.get('clean-if', []) cdict = dict() for d in clean: cdict.update(d) - for k, v in mask.iteritems(): + for k, v in mask: XML.SubElement(p, v).text = str(cdict.pop(k, True)).lower() if len(cdict) > 0: @@ -2199,14 +2104,10 @@ def maven_deploy(parser, xml_parent, data): (default false) - Example:: + Example: - publishers: - - maven-deploy: - id: example - url: http://repo.example.com/maven2/ - unique-version: true - deploy-unstable: false + .. literalinclude:: /../../tests/publishers/fixtures/maven-deploy001.yaml + :language: yaml """ p = XML.SubElement(xml_parent, 'hudson.maven.RedeployPublisher') @@ -2238,15 +2139,10 @@ def text_finder(parser, xml_parent, data): Set build unstable instead of failing the build (default False) - Example:: + Example: - publishers: - - text-finder: - regexp: "some string" - fileset: "file.txt" - also-check-console-output: true - succeed-if-found: false - unstable-if-found: false + .. literalinclude:: /../../tests/publishers/fixtures/text-finder001.yaml + :language: yaml """ finder = XML.SubElement(xml_parent, @@ -2276,15 +2172,10 @@ def html_publisher(parser, xml_parent, data): :arg bool allow-missing: Allow missing HTML reports (Default False) - Example:: + Example: - publishers: - - html-publisher: - name: "some name" - dir: "path/" - files: "index.html" - keep-all: true - allow-missing: true + .. literalinclude:: /../../tests/publishers/fixtures/html-publisher001.yaml + :language: yaml """ reporter = XML.SubElement(xml_parent, 'htmlpublisher.HtmlPublisher') @@ -2358,12 +2249,10 @@ def tap(parser, xml_parent, data): :arg bool todo-is-failure: Handle TODO's as failures (Default True) - Example:: + Example: - publishers: - - tap: - results: puiparts.tap - todo-is-failure: false + .. literalinclude:: /../../tests/publishers/fixtures/tap001.yaml + :language: yaml """ tap = XML.SubElement(xml_parent, 'org.tap4j.plugin.TapPublisher') @@ -2412,21 +2301,10 @@ def post_tasks(parser, xml_parent, data): (default 'false') :arg str task[script]: Shell script to run (default '') - Example:: + Example: - 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: false - run-if-job-successful:false - script: | - echo "Here goes the task script" + .. literalinclude:: /../../tests/publishers/fixtures/post-tasks001.yaml + :language: yaml """ pb_xml = XML.SubElement(xml_parent, @@ -2482,19 +2360,21 @@ def postbuildscript(parser, xml_parent, data): Example: - .. literalinclude:: /../../tests/publishers/fixtures/\ -postbuildscript001.yaml + .. literalinclude:: + /../../tests/publishers/fixtures/postbuildscript001.yaml + :language: yaml You can also execute :doc:`builders `: - .. literalinclude:: /../../tests/publishers/fixtures/\ -postbuildscript002.yaml + .. literalinclude:: + /../../tests/publishers/fixtures/postbuildscript002.yaml + :language: yaml Run once after the whole matrix (all axes) is built: - .. literalinclude:: /../../tests/publishers/fixtures/\ -postbuildscript003.yaml - + .. literalinclude:: + /../../tests/publishers/fixtures/postbuildscript003.yaml + :language: yaml """ pbs_xml = XML.SubElement( @@ -2586,11 +2466,10 @@ def xml_summary(parser, xml_parent, data): :arg str files: Files to parse (default '') - Example:: + Example: - publishers: - - xml-summary: - files: '*_summary_report.xml' + .. literalinclude:: /../../tests/publishers/fixtures/xml-summary001.yaml + :language: yaml """ summary = XML.SubElement(xml_parent, @@ -2624,21 +2503,10 @@ def robot(parser, xml_parent, data): checking the thresholds (default true) :arg list other-files: list other files to archive (default '') - Example:: + Example: - - publishers: - - robot: - output-path: reports/robot - log-file-link: report.html - report-html: report.html - log-html: log.html - output-xml: output.xml - pass-threshold: 80.0 - unstable-threshold: 60.0 - only-critical: false - other-files: - - extra-file1.html - - extra-file2.txt + .. literalinclude:: /../../tests/publishers/fixtures/robot001.yaml + :language: yaml """ parent = XML.SubElement(xml_parent, 'hudson.plugins.robot.RobotPublisher') XML.SubElement(parent, 'outputPath').text = data['output-path'] @@ -2756,51 +2624,10 @@ def warnings(parser, xml_parent, data): :arg str default-encoding: Default encoding when parsing or showing files Leave empty to use default encoding of platform (default '') - Example:: + Example: - 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 + .. literalinclude:: /../../tests/publishers/fixtures/warnings001.yaml + :language: yaml """ warnings = XML.SubElement(xml_parent, @@ -2887,13 +2714,10 @@ def sloccount(parser, xml_parent, data): :arg str charset: The character encoding to be used to read the SLOCCount result files. (default: 'UTF-8') - Example:: - - publishers: - - sloccount: - report-files: sloccount.sc - charset: UTF-8 + Example: + .. literalinclude:: /../../tests/publishers/fixtures/sloccount001.yaml + :language: yaml """ top = XML.SubElement(xml_parent, 'hudson.plugins.sloccount.SloccountPublisher') @@ -2964,6 +2788,7 @@ def ircbot(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/ircbot001.yaml + :language: yaml """ top = XML.SubElement(xml_parent, 'hudson.plugins.ircbot.IrcPublisher') message_dict = {'summary-scm': 'DefaultBuildToChatNotifier', @@ -3079,37 +2904,10 @@ def plot(parser, xml_parent, data): Xpath which selects the values that should be plotted. - Example:: - - publishers: - - plot: - - title: MyPlot - yaxis: Y - 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 - group: PlotGroup - style: line - use-description: false - series: - - file: graph-me-third.xml - url: 'http://srv2' - format: xml - xpath-type: 'node' - xpath: '/*' + Example: + .. literalinclude:: /../../tests/publishers/fixtures/plot004.yaml + :language: yaml """ top = XML.SubElement(xml_parent, 'hudson.plugins.plot.PlotPublisher') plots = XML.SubElement(top, 'plots') @@ -3222,30 +3020,10 @@ def git(parser, xml_parent, data): (Default: False) - Example:: - - publishers: - - git: - push-merge: true - push-only-if-success: false - tags: - - tag: - remote: tagremotename - name: tagname - message: "some tag message" - create-tag: true - update-tag: true - branches: - - branch: - remote: branchremotename - name: "some/branch" - notes: - - note: - remote: remotename - message: "some note to push" - namespace: commits - replace-note: true + Example: + .. literalinclude:: /../../tests/publishers/fixtures/git001.yaml + :language: yaml """ mappings = [('push-merge', 'pushMerge', False), ('push-only-if-success', 'pushOnlyIfSuccess', True)] @@ -3315,6 +3093,7 @@ def github_notifier(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/github-notifier.yaml + :language: yaml """ XML.SubElement(xml_parent, 'com.cloudbees.jenkins.GitHubCommitNotifier') @@ -3337,7 +3116,8 @@ def build_publisher(parser, xml_parent, data): Example: .. literalinclude:: - /../../tests/publishers/fixtures/build-publisher002.yaml + /../../tests/publishers/fixtures/build-publisher002.yaml + :language: yaml """ reporter = XML.SubElement( @@ -3380,6 +3160,7 @@ def stash(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/stash001.yaml + :language: yaml """ top = XML.SubElement(xml_parent, @@ -3415,8 +3196,8 @@ def description_setter(parser, xml_parent, data): Example: .. literalinclude:: - /../../tests/publishers/fixtures/description-setter001.yaml - + /../../tests/publishers/fixtures/description-setter001.yaml + :language: yaml """ descriptionsetter = XML.SubElement( @@ -3450,7 +3231,7 @@ def doxygen(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/doxygen001.yaml - + :language: yaml """ p = XML.SubElement(xml_parent, 'hudson.plugins.doxygen.DoxygenArchiver') if not data['doxyfile']: @@ -3472,7 +3253,7 @@ def sitemonitor(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/sitemonitor001.yaml - + :language: yaml """ mon = XML.SubElement(xml_parent, 'hudson.plugins.sitemonitor.SiteMonitorRecorder') @@ -3500,7 +3281,7 @@ def testng(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/testng001.yaml - + :language: yaml """ reporter = XML.SubElement(xml_parent, 'hudson.plugins.testng.Publisher') @@ -3542,7 +3323,7 @@ def artifact_deployer(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/artifact-dep.yaml - + :language: yaml """ deployer = XML.SubElement(xml_parent, @@ -3671,7 +3452,7 @@ def ruby_metrics(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/ruby-metrics.yaml - + :language: yaml """ metrics = XML.SubElement( @@ -3710,7 +3491,7 @@ def fitnesse(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/fitnesse001.yaml - + :language: yaml """ fitnesse = XML.SubElement( xml_parent, @@ -3751,7 +3532,7 @@ def valgrind(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/valgrind001.yaml - + :language: yaml """ p = XML.SubElement(xml_parent, 'org.jenkinsci.plugins.valgrind.ValgrindPublisher') @@ -3838,11 +3619,12 @@ def pmd(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/pmd001.yaml + :language: yaml Full example: .. literalinclude:: /../../tests/publishers/fixtures/pmd002.yaml - + :language: yaml """ xml_element = XML.SubElement(xml_parent, 'hudson.plugins.pmd.PmdPublisher') @@ -3867,7 +3649,7 @@ def scan_build(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/scan-build001.yaml - + :language: yaml """ threshold = str(data.get('threshold', 0)) if not threshold.isdigit(): @@ -3941,11 +3723,12 @@ def dry(parser, xml_parent, data): Example: .. literalinclude:: /../../tests/publishers/fixtures/dry001.yaml + :language: yaml Full example: .. literalinclude:: /../../tests/publishers/fixtures/dry004.yaml - + :language: yaml """ xml_element = XML.SubElement(xml_parent, 'hudson.plugins.dry.DryPublisher') diff --git a/tests/publishers/fixtures/aggregate-tests001.xml b/tests/publishers/fixtures/aggregate-tests001.xml new file mode 100644 index 000000000..afe312e9f --- /dev/null +++ b/tests/publishers/fixtures/aggregate-tests001.xml @@ -0,0 +1,8 @@ + + + + + true + + + diff --git a/tests/publishers/fixtures/aggregate-tests001.yaml b/tests/publishers/fixtures/aggregate-tests001.yaml new file mode 100644 index 000000000..606987744 --- /dev/null +++ b/tests/publishers/fixtures/aggregate-tests001.yaml @@ -0,0 +1,3 @@ +publishers: + - aggregate-tests: + include-failed-builds: true diff --git a/tests/publishers/fixtures/claim-build001.xml b/tests/publishers/fixtures/claim-build001.xml new file mode 100644 index 000000000..8947e883e --- /dev/null +++ b/tests/publishers/fixtures/claim-build001.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/publishers/fixtures/claim-build001.yaml b/tests/publishers/fixtures/claim-build001.yaml new file mode 100644 index 000000000..eb5fb6841 --- /dev/null +++ b/tests/publishers/fixtures/claim-build001.yaml @@ -0,0 +1,2 @@ +publishers: + - claim-build diff --git a/tests/publishers/fixtures/cobertura001.xml b/tests/publishers/fixtures/cobertura001.xml new file mode 100644 index 000000000..e47546209 --- /dev/null +++ b/tests/publishers/fixtures/cobertura001.xml @@ -0,0 +1,52 @@ + + + + + /reports/cobertura/coverage.xml + true + true + true + true + true + true + true + + + + FILES + 10 + + + METHOD + 50 + + + + + + + FILES + 20 + + + METHOD + 40 + + + + + + + FILES + 30 + + + METHOD + 30 + + + + Big5 + + + diff --git a/tests/publishers/fixtures/cobertura001.yaml b/tests/publishers/fixtures/cobertura001.yaml new file mode 100644 index 000000000..3105293e5 --- /dev/null +++ b/tests/publishers/fixtures/cobertura001.yaml @@ -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 diff --git a/tests/publishers/fixtures/copy-to-master001.xml b/tests/publishers/fixtures/copy-to-master001.xml new file mode 100644 index 000000000..1eef06326 --- /dev/null +++ b/tests/publishers/fixtures/copy-to-master001.xml @@ -0,0 +1,10 @@ + + + + + file1,file2*.txt + file2bad.txt + + + + diff --git a/tests/publishers/fixtures/copy-to-master001.yaml b/tests/publishers/fixtures/copy-to-master001.yaml new file mode 100644 index 000000000..80581a310 --- /dev/null +++ b/tests/publishers/fixtures/copy-to-master001.yaml @@ -0,0 +1,7 @@ +publishers: + - copy-to-master: + includes: + - file1 + - file2*.txt + excludes: + - file2bad.txt diff --git a/tests/publishers/fixtures/coverage001.xml b/tests/publishers/fixtures/coverage001.xml new file mode 100644 index 000000000..7fd110e08 --- /dev/null +++ b/tests/publishers/fixtures/coverage001.xml @@ -0,0 +1,58 @@ + + + + + **/coverage.xml + false + + + + CONDITIONAL + 70 + + + LINE + 80 + + + METHOD + 80 + + + + + + + CONDITIONAL + 0 + + + LINE + 0 + + + METHOD + 0 + + + + + + + CONDITIONAL + 0 + + + LINE + 0 + + + METHOD + 0 + + + + ASCII + + + diff --git a/tests/publishers/fixtures/coverage001.yaml b/tests/publishers/fixtures/coverage001.yaml new file mode 100644 index 000000000..c75d9cbb8 --- /dev/null +++ b/tests/publishers/fixtures/coverage001.yaml @@ -0,0 +1,2 @@ +publishers: + - coverage diff --git a/tests/publishers/fixtures/cppcheck001.xml b/tests/publishers/fixtures/cppcheck001.xml new file mode 100644 index 000000000..65b310329 --- /dev/null +++ b/tests/publishers/fixtures/cppcheck001.xml @@ -0,0 +1,34 @@ + + + + + + **/cppcheck.xml + false + + 5 + 5 + 7 + 3 + + + true + true + true + true + false + + + 500 + 200 + false + true + false + false + false + false + + + + + diff --git a/tests/publishers/fixtures/cppcheck001.yaml b/tests/publishers/fixtures/cppcheck001.yaml new file mode 100644 index 000000000..34408a7b7 --- /dev/null +++ b/tests/publishers/fixtures/cppcheck001.yaml @@ -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 diff --git a/tests/publishers/fixtures/fingerprint001.xml b/tests/publishers/fixtures/fingerprint001.xml new file mode 100644 index 000000000..da6341a4e --- /dev/null +++ b/tests/publishers/fixtures/fingerprint001.xml @@ -0,0 +1,9 @@ + + + + + builddir/test*.xml + false + + + diff --git a/tests/publishers/fixtures/fingerprint001.yaml b/tests/publishers/fixtures/fingerprint001.yaml new file mode 100644 index 000000000..6358d1904 --- /dev/null +++ b/tests/publishers/fixtures/fingerprint001.yaml @@ -0,0 +1,4 @@ +publishers: + - fingerprint: + files: builddir/test*.xml + record-artifacts: false diff --git a/tests/publishers/fixtures/groovy-postbuild001.xml b/tests/publishers/fixtures/groovy-postbuild001.xml new file mode 100644 index 000000000..1d06d423f --- /dev/null +++ b/tests/publishers/fixtures/groovy-postbuild001.xml @@ -0,0 +1,8 @@ + + + + + manager.buildFailure() + + + diff --git a/tests/publishers/fixtures/groovy-postbuild001.yaml b/tests/publishers/fixtures/groovy-postbuild001.yaml new file mode 100644 index 000000000..bd17ddc35 --- /dev/null +++ b/tests/publishers/fixtures/groovy-postbuild001.yaml @@ -0,0 +1,2 @@ +publishers: + - groovy-postbuild: "manager.buildFailure()" diff --git a/tests/publishers/fixtures/html-publisher001.xml b/tests/publishers/fixtures/html-publisher001.xml new file mode 100644 index 000000000..f2ac8758d --- /dev/null +++ b/tests/publishers/fixtures/html-publisher001.xml @@ -0,0 +1,17 @@ + + + + + + + some name + path/ + index.html + true + true + htmlpublisher-wrapper.html + + + + + diff --git a/tests/publishers/fixtures/html-publisher001.yaml b/tests/publishers/fixtures/html-publisher001.yaml new file mode 100644 index 000000000..aa85be6cb --- /dev/null +++ b/tests/publishers/fixtures/html-publisher001.yaml @@ -0,0 +1,7 @@ +publishers: + - html-publisher: + name: "some name" + dir: "path/" + files: "index.html" + keep-all: true + allow-missing: true diff --git a/tests/publishers/fixtures/jabber001.xml b/tests/publishers/fixtures/jabber001.xml new file mode 100644 index 000000000..409e1a0c2 --- /dev/null +++ b/tests/publishers/fixtures/jabber001.xml @@ -0,0 +1,24 @@ + + + + + + + foo-room@conference-2-fooserver.foo.com + false + + + foo-user@conference-2-fooserver.foo.com + + + ALL + true + false + false + false + false + + ONLY_CONFIGURATIONS + + + diff --git a/tests/publishers/fixtures/jabber001.yaml b/tests/publishers/fixtures/jabber001.yaml new file mode 100644 index 000000000..31735f9af --- /dev/null +++ b/tests/publishers/fixtures/jabber001.yaml @@ -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 diff --git a/tests/publishers/fixtures/jacoco001.xml b/tests/publishers/fixtures/jacoco001.xml new file mode 100644 index 000000000..7077d8302 --- /dev/null +++ b/tests/publishers/fixtures/jacoco001.xml @@ -0,0 +1,17 @@ + + + + + **/**.exec + **/classes + **/src/main/java + + + + 10 + 20 + 50 + 40 + + + diff --git a/tests/publishers/fixtures/jacoco001.yaml b/tests/publishers/fixtures/jacoco001.yaml new file mode 100644 index 000000000..604196104 --- /dev/null +++ b/tests/publishers/fixtures/jacoco001.yaml @@ -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 diff --git a/tests/publishers/fixtures/jira001.xml b/tests/publishers/fixtures/jira001.xml new file mode 100644 index 000000000..d08288abb --- /dev/null +++ b/tests/publishers/fixtures/jira001.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/publishers/fixtures/jira001.yaml b/tests/publishers/fixtures/jira001.yaml new file mode 100644 index 000000000..86000ab0b --- /dev/null +++ b/tests/publishers/fixtures/jira001.yaml @@ -0,0 +1,2 @@ +publishers: + - jira diff --git a/tests/publishers/fixtures/join-trigger001.xml b/tests/publishers/fixtures/join-trigger001.xml new file mode 100644 index 000000000..2fdde2071 --- /dev/null +++ b/tests/publishers/fixtures/join-trigger001.xml @@ -0,0 +1,8 @@ + + + + + project-one,project-two + + + diff --git a/tests/publishers/fixtures/join-trigger001.yaml b/tests/publishers/fixtures/join-trigger001.yaml new file mode 100644 index 000000000..6caf196a3 --- /dev/null +++ b/tests/publishers/fixtures/join-trigger001.yaml @@ -0,0 +1,5 @@ +publishers: + - join-trigger: + projects: + - project-one + - project-two diff --git a/tests/publishers/fixtures/logparser001.xml b/tests/publishers/fixtures/logparser001.xml new file mode 100644 index 000000000..44881b70a --- /dev/null +++ b/tests/publishers/fixtures/logparser001.xml @@ -0,0 +1,10 @@ + + + + + true + true + /path/to/parserules + + + diff --git a/tests/publishers/fixtures/logparser001.yaml b/tests/publishers/fixtures/logparser001.yaml new file mode 100644 index 000000000..7749e120d --- /dev/null +++ b/tests/publishers/fixtures/logparser001.yaml @@ -0,0 +1,5 @@ +publishers: + - logparser: + parse-rules: "/path/to/parserules" + unstable-on-warning: true + fail-on-error: true diff --git a/tests/publishers/fixtures/mavendeploy001.xml b/tests/publishers/fixtures/maven-deploy001.xml similarity index 77% rename from tests/publishers/fixtures/mavendeploy001.xml rename to tests/publishers/fixtures/maven-deploy001.xml index 327dddc02..64e096271 100644 --- a/tests/publishers/fixtures/mavendeploy001.xml +++ b/tests/publishers/fixtures/maven-deploy001.xml @@ -2,7 +2,8 @@ - file:///path/to/repo + example + http://repo.example.com/maven2/ true false diff --git a/tests/publishers/fixtures/maven-deploy001.yaml b/tests/publishers/fixtures/maven-deploy001.yaml new file mode 100644 index 000000000..a8384a8dc --- /dev/null +++ b/tests/publishers/fixtures/maven-deploy001.yaml @@ -0,0 +1,6 @@ +publishers: + - maven-deploy: + id: example + url: http://repo.example.com/maven2/ + unique-version: true + deploy-unstable: false diff --git a/tests/publishers/fixtures/mavendeploy001.yaml b/tests/publishers/fixtures/mavendeploy001.yaml deleted file mode 100644 index d16b9632d..000000000 --- a/tests/publishers/fixtures/mavendeploy001.yaml +++ /dev/null @@ -1,4 +0,0 @@ -publishers: - - maven-deploy: - url: file:///path/to/repo - diff --git a/tests/publishers/fixtures/performance001.xml b/tests/publishers/fixtures/performance001.xml new file mode 100644 index 000000000..5419d025c --- /dev/null +++ b/tests/publishers/fixtures/performance001.xml @@ -0,0 +1,17 @@ + + + + + 85 + -1 + + + /special/file.jtl + + + /special/file.xml + + + + + diff --git a/tests/publishers/fixtures/performance001.yaml b/tests/publishers/fixtures/performance001.yaml new file mode 100644 index 000000000..5e717cb8d --- /dev/null +++ b/tests/publishers/fixtures/performance001.yaml @@ -0,0 +1,7 @@ +publishers: + - performance: + failed-threshold: 85 + unstable-threshold: -1 + report: + - jmeter: "/special/file.jtl" + - junit: "/special/file.xml" diff --git a/tests/publishers/fixtures/performance002.xml b/tests/publishers/fixtures/performance002.xml new file mode 100644 index 000000000..7f7d5f061 --- /dev/null +++ b/tests/publishers/fixtures/performance002.xml @@ -0,0 +1,17 @@ + + + + + 85 + -1 + + + **/*.jtl + + + **/TEST-*.xml + + + + + diff --git a/tests/publishers/fixtures/performance002.yaml b/tests/publishers/fixtures/performance002.yaml new file mode 100644 index 000000000..b970cd98c --- /dev/null +++ b/tests/publishers/fixtures/performance002.yaml @@ -0,0 +1,7 @@ +publishers: + - performance: + failed-threshold: 85 + unstable-threshold: -1 + report: + - jmeter + - junit diff --git a/tests/publishers/fixtures/performance003.xml b/tests/publishers/fixtures/performance003.xml new file mode 100644 index 000000000..b7acfb199 --- /dev/null +++ b/tests/publishers/fixtures/performance003.xml @@ -0,0 +1,23 @@ + + + + + 85 + -1 + + + /special/file.jtl + + + /special/file.xml + + + **/*.jtl + + + **/TEST-*.xml + + + + + diff --git a/tests/publishers/fixtures/performance003.yaml b/tests/publishers/fixtures/performance003.yaml new file mode 100644 index 000000000..478c4e281 --- /dev/null +++ b/tests/publishers/fixtures/performance003.yaml @@ -0,0 +1,9 @@ +publishers: + - performance: + failed-threshold: 85 + unstable-threshold: -1 + report: + - jmeter: "/special/file.jtl" + - junit: "/special/file.xml" + - jmeter + - junit diff --git a/tests/publishers/fixtures/plot004.xml b/tests/publishers/fixtures/plot004.xml new file mode 100644 index 000000000..ac799a3db --- /dev/null +++ b/tests/publishers/fixtures/plot004.xml @@ -0,0 +1,51 @@ + + + + + + + MyPlot + Y + myplot.csv + + + graph-me-second.properties + + properties + + + graph-me-first.csv + OFF + + http://srv1 + false + csv + + + PlotGroup + false + + + + + MyPlot2 + Y + myplot2.csv + + + graph-me-third.xml + http://srv2 + /* + NODE + xml + + + PlotGroup + false + + + + + + + diff --git a/tests/publishers/fixtures/plot004.yaml b/tests/publishers/fixtures/plot004.yaml new file mode 100644 index 000000000..2e16c8d18 --- /dev/null +++ b/tests/publishers/fixtures/plot004.yaml @@ -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: '/*' diff --git a/tests/publishers/fixtures/post-tasks001.xml b/tests/publishers/fixtures/post-tasks001.xml new file mode 100644 index 000000000..a30dc22ec --- /dev/null +++ b/tests/publishers/fixtures/post-tasks001.xml @@ -0,0 +1,29 @@ + + + + + + + + + line to match + AND + + + line to match + OR + + + line to match + AND + + + true + true + + + + + + diff --git a/tests/publishers/fixtures/post-tasks001.yaml b/tests/publishers/fixtures/post-tasks001.yaml new file mode 100644 index 000000000..36d0e3160 --- /dev/null +++ b/tests/publishers/fixtures/post-tasks001.yaml @@ -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" diff --git a/tests/publishers/fixtures/robot001.xml b/tests/publishers/fixtures/robot001.xml new file mode 100644 index 000000000..0560aa430 --- /dev/null +++ b/tests/publishers/fixtures/robot001.xml @@ -0,0 +1,19 @@ + + + + + reports/robot + report.html + custom-report.html + custom-log.html + custom-output.xml + 80.0 + 60.0 + false + + extra-file1.html + extra-file2.txt + + + + diff --git a/tests/publishers/fixtures/robot001.yaml b/tests/publishers/fixtures/robot001.yaml new file mode 100644 index 000000000..291934437 --- /dev/null +++ b/tests/publishers/fixtures/robot001.yaml @@ -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 diff --git a/tests/publishers/fixtures/sloccount001.xml b/tests/publishers/fixtures/sloccount001.xml new file mode 100644 index 000000000..0e9a22e97 --- /dev/null +++ b/tests/publishers/fixtures/sloccount001.xml @@ -0,0 +1,9 @@ + + + + + sloccount.sc + latin-1 + + + diff --git a/tests/publishers/fixtures/sloccount001.yaml b/tests/publishers/fixtures/sloccount001.yaml new file mode 100644 index 000000000..cac1e96ba --- /dev/null +++ b/tests/publishers/fixtures/sloccount001.yaml @@ -0,0 +1,4 @@ +publishers: + - sloccount: + report-files: sloccount.sc + charset: latin-1 diff --git a/tests/publishers/fixtures/sonar001.xml b/tests/publishers/fixtures/sonar001.xml new file mode 100644 index 000000000..01dca17b9 --- /dev/null +++ b/tests/publishers/fixtures/sonar001.xml @@ -0,0 +1,17 @@ + + + + + MyJdk + myBranch + java + -DskipTests + -DsonarHostURL=http://example.com/ + + true + true + SKIP_SONAR + + + + diff --git a/tests/publishers/fixtures/sonar001.yaml b/tests/publishers/fixtures/sonar001.yaml new file mode 100644 index 000000000..f5942deff --- /dev/null +++ b/tests/publishers/fixtures/sonar001.yaml @@ -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 diff --git a/tests/publishers/fixtures/tap001.xml b/tests/publishers/fixtures/tap001.xml new file mode 100644 index 000000000..4ac719752 --- /dev/null +++ b/tests/publishers/fixtures/tap001.xml @@ -0,0 +1,14 @@ + + + + + puiparts.tap + false + false + true + true + false + false + + + diff --git a/tests/publishers/fixtures/tap001.yaml b/tests/publishers/fixtures/tap001.yaml new file mode 100644 index 000000000..0d40766de --- /dev/null +++ b/tests/publishers/fixtures/tap001.yaml @@ -0,0 +1,4 @@ +publishers: + - tap: + results: puiparts.tap + todo-is-failure: false diff --git a/tests/publishers/fixtures/text-finder001.xml b/tests/publishers/fixtures/text-finder001.xml new file mode 100644 index 000000000..03a388cee --- /dev/null +++ b/tests/publishers/fixtures/text-finder001.xml @@ -0,0 +1,12 @@ + + + + + file.txt + some string + true + false + false + + + diff --git a/tests/publishers/fixtures/text-finder001.yaml b/tests/publishers/fixtures/text-finder001.yaml new file mode 100644 index 000000000..3bf42311b --- /dev/null +++ b/tests/publishers/fixtures/text-finder001.yaml @@ -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 diff --git a/tests/publishers/fixtures/violations001.xml b/tests/publishers/fixtures/violations001.xml new file mode 100644 index 000000000..d7cb27586 --- /dev/null +++ b/tests/publishers/fixtures/violations001.xml @@ -0,0 +1,195 @@ + + + + + + + + + + + + checkstyle + + checkstyle + 10 + 999 + 999 + false + + + + + codenarc + + codenarc + 10 + 999 + 999 + false + + + + + cpd + + cpd + 10 + 999 + 999 + false + + + + + cpplint + + cpplint + 10 + 999 + 999 + false + + + + + csslint + + csslint + 10 + 999 + 999 + false + + + + + findbugs + + findbugs + 10 + 999 + 999 + false + + + + + fxcop + + fxcop + 10 + 999 + 999 + false + + + + + gendarme + + gendarme + 10 + 999 + 999 + false + + + + + jcreport + + jcreport + 10 + 999 + 999 + false + + + + + jslint + + jslint + 10 + 999 + 999 + false + + + + + pep8 + + pep8 + 0 + 1 + 1 + false + **/pep8.txt + + + + perlcritic + + perlcritic + 10 + 999 + 999 + false + + + + + pmd + + pmd + 10 + 999 + 999 + false + + + + + pylint + + pylint + 10 + 999 + 999 + false + + + + + simian + + simian + 10 + 999 + 999 + false + + + + + stylecop + + stylecop + 10 + 999 + 999 + false + + + + + 100 + + + default + + + + diff --git a/tests/publishers/fixtures/violations001.yaml b/tests/publishers/fixtures/violations001.yaml new file mode 100644 index 000000000..fbc069b9d --- /dev/null +++ b/tests/publishers/fixtures/violations001.yaml @@ -0,0 +1,7 @@ +publishers: + - violations: + pep8: + min: 0 + max: 1 + unstable: 1 + pattern: '**/pep8.txt' diff --git a/tests/publishers/fixtures/warnings001.xml b/tests/publishers/fixtures/warnings001.xml new file mode 100644 index 000000000..0d0f4097f --- /dev/null +++ b/tests/publishers/fixtures/warnings001.xml @@ -0,0 +1,55 @@ + + + + + + + FxCop + + + CodeAnalysis + + + + + **/*.out + AcuCobol Compiler + + + **/*.warnings + FxCop + + + [a-zA-Z]\.java,[a-zA-Z]\.cpp + [a-zA-Z]\.html,[a-zA-Z]\.js + true + true + false + 50 + 25 + normal + + 90 + 90 + 40 + 30 + 100 + 100 + 50 + 40 + 100 + 50 + 30 + 10 + 100 + 60 + 50 + 40 + + false + true + true + ISO-8859-9 + + + diff --git a/tests/publishers/fixtures/warnings001.yaml b/tests/publishers/fixtures/warnings001.yaml new file mode 100644 index 000000000..19f8879f7 --- /dev/null +++ b/tests/publishers/fixtures/warnings001.yaml @@ -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 diff --git a/tests/publishers/fixtures/workspace-cleanup001.xml b/tests/publishers/fixtures/workspace-cleanup001.xml new file mode 100644 index 000000000..dc6371567 --- /dev/null +++ b/tests/publishers/fixtures/workspace-cleanup001.xml @@ -0,0 +1,21 @@ + + + + + + + *.zip + INCLUDE + + + false + false + true + true + true + false + true + true + + + diff --git a/tests/publishers/fixtures/workspace-cleanup001.yaml b/tests/publishers/fixtures/workspace-cleanup001.yaml new file mode 100644 index 000000000..79caf3b73 --- /dev/null +++ b/tests/publishers/fixtures/workspace-cleanup001.yaml @@ -0,0 +1,7 @@ +publishers: + - workspace-cleanup: + include: + - "*.zip" + clean-if: + - success: true + - not-built: false diff --git a/tests/publishers/fixtures/xml-summary001.xml b/tests/publishers/fixtures/xml-summary001.xml new file mode 100644 index 000000000..e029c955e --- /dev/null +++ b/tests/publishers/fixtures/xml-summary001.xml @@ -0,0 +1,8 @@ + + + + + *_summary_report.xml + + + diff --git a/tests/publishers/fixtures/xml-summary001.yaml b/tests/publishers/fixtures/xml-summary001.yaml new file mode 100644 index 000000000..6205df44e --- /dev/null +++ b/tests/publishers/fixtures/xml-summary001.yaml @@ -0,0 +1,3 @@ +publishers: + - xml-summary: + files: '*_summary_report.xml'