Update cucumber-testresult plugin
- update cucumber-testresult plugin to use convert xml - add plugin="cucumber-testresult-plugin" attribute - add new parameter 'ignore-bad-steps' support - update test cases Change-Id: I8ef353fea030dc0aab0cf9f006fdc84c72834ee7
This commit is contained in:
parent
a463b12f29
commit
bff19ac90b
@ -1198,23 +1198,33 @@ def cucumber_testresult(registry, xml_parent, data):
|
||||
Requires the Jenkins :jenkins-wiki:`cucumber testresult
|
||||
<Cucumber+Test+Result+Plugin>`.
|
||||
|
||||
:arg str results: results filename (required)
|
||||
:arg str results: Results filename (required)
|
||||
:arg bool ignore-bad-steps: Ignore not existed step results (default false)
|
||||
|
||||
Example:
|
||||
Minimal example:
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/publishers/fixtures/cucumber_testresult.yaml
|
||||
:language: yaml
|
||||
/../../tests/publishers/fixtures/cucumber-testresult-minimal.yaml
|
||||
:language: yaml
|
||||
|
||||
Full Example:
|
||||
|
||||
.. literalinclude::
|
||||
/../../tests/publishers/fixtures/cucumber-testresult-complete.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)
|
||||
cucumber_result.set('plugin', 'cucumber-testresult-plugin')
|
||||
|
||||
mappings = [
|
||||
('results', 'testResults', None),
|
||||
('ignore-bad-steps', 'ignoreBadSteps', False)
|
||||
]
|
||||
helpers.convert_mapping_to_xml(
|
||||
cucumber_result, data, mappings, fail_required=True)
|
||||
|
||||
|
||||
def xunit(registry, xml_parent, data):
|
||||
|
@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver>
|
||||
<org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver plugin="cucumber-testresult-plugin">
|
||||
<testResults>nosetests.xml</testResults>
|
||||
<ignoreBadSteps>true</ignoreBadSteps>
|
||||
</org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver>
|
||||
</publishers>
|
||||
</project>
|
@ -0,0 +1,4 @@
|
||||
publishers:
|
||||
- cucumber-testresult:
|
||||
results: nosetests.xml
|
||||
ignore-bad-steps: true
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver plugin="cucumber-testresult-plugin">
|
||||
<testResults>nosetests.xml</testResults>
|
||||
<ignoreBadSteps>false</ignoreBadSteps>
|
||||
</org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultArchiver>
|
||||
</publishers>
|
||||
</project>
|
Loading…
Reference in New Issue
Block a user