Add support for the CucumberTestResult plugin.

Change-Id: I6eca56542953f3f18bda5dd6dfe50c16f560dc2d
This commit is contained in:
bertagaz 2015-08-30 17:24:19 +02:00
parent dc28559b05
commit ced997288e
4 changed files with 37 additions and 0 deletions

View File

@ -931,6 +931,31 @@ def junit(parser, xml_parent, data):
'hudson.plugins.measurement__plots.TestDataPublisher')
def cucumber_testresult(parser, xml_parent, data):
"""yaml: cucumber
Publish cucumber test results.
Requires the Jenkins :jenkins-wiki:`cucumber testresult
<Cucumber+Test+Result+Plugin>`.
:arg str results: results filename (required)
Example:
.. literalinclude::
/../../tests/publishers/fixtures/cucumber_testresult.yaml
:language: yaml
"""
cucumber_result = XML.SubElement(xml_parent,
'org.jenkinsci.plugins.cucumber.'
'jsontestsupport.'
'CucumberTestResultArchiver')
filepath = data.get('results', None)
if filepath is None:
raise MissingAttributeError('results')
XML.SubElement(cucumber_result, 'testResults').text = str(filepath)
def xunit(parser, xml_parent, data):
"""yaml: xunit
Publish tests results. Requires the Jenkins :jenkins-wiki:`xUnit Plugin

View File

@ -151,6 +151,7 @@ jenkins_jobs.publishers =
copy-to-master=jenkins_jobs.modules.publishers:copy_to_master
coverage=jenkins_jobs.modules.publishers:coverage
cppcheck=jenkins_jobs.modules.publishers:cppcheck
cucumber_testresult=jenkins_jobs.modules.publishers:cucumber_testresult
description-setter=jenkins_jobs.modules.publishers:description_setter
disable-failed-job=jenkins_jobs.modules.publishers:disable_failed_job
display-upstream-changes=jenkins_jobs.modules.publishers:display_upstream_changes

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver>
<testResults>nosetests.xml</testResults>
</org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver>
</publishers>
</project>

View File

@ -0,0 +1,3 @@
publishers:
- cucumber_testresult:
results: nosetests.xml