Update robot plugin
- update robot plugin to convert xml - update docstring - update test cases - add plugin="robot" attribute Change-Id: I350d99beca71fcb6932491b3709ee2b6d89ca642
This commit is contained in:
parent
08113e362a
commit
33fc571832
jenkins_jobs/modules
tests/publishers/fixtures
@ -3673,7 +3673,7 @@ def robot(registry, xml_parent, data):
|
|||||||
<Robot+Framework+Plugin>`.
|
<Robot+Framework+Plugin>`.
|
||||||
|
|
||||||
:arg str output-path: Path to directory containing robot xml and html files
|
:arg str output-path: Path to directory containing robot xml and html files
|
||||||
relative to build workspace. (default '')
|
relative to build workspace. (required)
|
||||||
:arg str log-file-link: Name of log or report file to be linked on jobs
|
:arg str log-file-link: Name of log or report file to be linked on jobs
|
||||||
front page (default '')
|
front page (default '')
|
||||||
:arg str report-html: Name of the html file containing robot test report
|
:arg str report-html: Name of the html file containing robot test report
|
||||||
@ -3691,30 +3691,35 @@ def robot(registry, xml_parent, data):
|
|||||||
:arg list other-files: list other files to archive (default '')
|
:arg list other-files: list other files to archive (default '')
|
||||||
:arg bool archive-output-xml: Archive output xml file to server
|
:arg bool archive-output-xml: Archive output xml file to server
|
||||||
(default true)
|
(default true)
|
||||||
|
:arg bool enable-cache: Enable cache for test results (default true)
|
||||||
|
|
||||||
Example:
|
Minimal Example:
|
||||||
|
|
||||||
.. literalinclude:: /../../tests/publishers/fixtures/robot001.yaml
|
.. literalinclude:: /../../tests/publishers/fixtures/robot-minimal.yaml
|
||||||
|
:language: yaml
|
||||||
|
|
||||||
|
Full Example:
|
||||||
|
|
||||||
|
.. literalinclude:: /../../tests/publishers/fixtures/robot-complete.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
"""
|
"""
|
||||||
parent = XML.SubElement(xml_parent, 'hudson.plugins.robot.RobotPublisher')
|
parent = XML.SubElement(xml_parent, 'hudson.plugins.robot.RobotPublisher')
|
||||||
XML.SubElement(parent, 'outputPath').text = data['output-path']
|
parent.set('plugin', 'robot')
|
||||||
XML.SubElement(parent, 'logFileLink').text = str(
|
mappings = [
|
||||||
data.get('log-file-link', ''))
|
('output-path', 'outputPath', None),
|
||||||
XML.SubElement(parent, 'reportFileName').text = str(
|
('log-file-link', 'logFileLink', ''),
|
||||||
data.get('report-html', 'report.html'))
|
('report-html', 'reportFileName', 'report.html'),
|
||||||
XML.SubElement(parent, 'logFileName').text = str(
|
('log-html', 'logFileName', 'log.html'),
|
||||||
data.get('log-html', 'log.html'))
|
('output-xml', 'outputFileName', 'output.xml'),
|
||||||
XML.SubElement(parent, 'outputFileName').text = str(
|
('pass-threshold', 'passThreshold', '0.0'),
|
||||||
data.get('output-xml', 'output.xml'))
|
('unstable-threshold', 'unstableThreshold', '0.0'),
|
||||||
XML.SubElement(parent, 'passThreshold').text = str(
|
('only-critical', 'onlyCritical', True),
|
||||||
data.get('pass-threshold', 0.0))
|
('enable-cache', 'enableCache', True)
|
||||||
XML.SubElement(parent, 'unstableThreshold').text = str(
|
]
|
||||||
data.get('unstable-threshold', 0.0))
|
helpers.convert_mapping_to_xml(parent, data, mappings, fail_required=True)
|
||||||
XML.SubElement(parent, 'onlyCritical').text = str(
|
|
||||||
data.get('only-critical', True)).lower()
|
|
||||||
other_files = XML.SubElement(parent, 'otherFiles')
|
other_files = XML.SubElement(parent, 'otherFiles')
|
||||||
for other_file in data['other-files']:
|
for other_file in data.get('other-files', []):
|
||||||
XML.SubElement(other_files, 'string').text = str(other_file)
|
XML.SubElement(other_files, 'string').text = str(other_file)
|
||||||
XML.SubElement(parent, 'disableArchiveOutput').text = str(
|
XML.SubElement(parent, 'disableArchiveOutput').text = str(
|
||||||
not data.get('archive-output-xml', True)).lower()
|
not data.get('archive-output-xml', True)).lower()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<publishers>
|
<publishers>
|
||||||
<hudson.plugins.robot.RobotPublisher>
|
<hudson.plugins.robot.RobotPublisher plugin="robot">
|
||||||
<outputPath>reports/robot</outputPath>
|
<outputPath>reports/robot</outputPath>
|
||||||
<logFileLink>report.html</logFileLink>
|
<logFileLink>report.html</logFileLink>
|
||||||
<reportFileName>custom-report.html</reportFileName>
|
<reportFileName>custom-report.html</reportFileName>
|
||||||
@ -10,6 +10,7 @@
|
|||||||
<passThreshold>80.0</passThreshold>
|
<passThreshold>80.0</passThreshold>
|
||||||
<unstableThreshold>60.0</unstableThreshold>
|
<unstableThreshold>60.0</unstableThreshold>
|
||||||
<onlyCritical>false</onlyCritical>
|
<onlyCritical>false</onlyCritical>
|
||||||
|
<enableCache>false</enableCache>
|
||||||
<otherFiles>
|
<otherFiles>
|
||||||
<string>extra-file1.html</string>
|
<string>extra-file1.html</string>
|
||||||
<string>extra-file2.txt</string>
|
<string>extra-file2.txt</string>
|
@ -8,6 +8,7 @@ publishers:
|
|||||||
pass-threshold: 80.0
|
pass-threshold: 80.0
|
||||||
unstable-threshold: 60.0
|
unstable-threshold: 60.0
|
||||||
only-critical: false
|
only-critical: false
|
||||||
|
enable-cache: false
|
||||||
other-files:
|
other-files:
|
||||||
- extra-file1.html
|
- extra-file1.html
|
||||||
- extra-file2.txt
|
- extra-file2.txt
|
18
tests/publishers/fixtures/robot-minimal.xml
Normal file
18
tests/publishers/fixtures/robot-minimal.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<publishers>
|
||||||
|
<hudson.plugins.robot.RobotPublisher plugin="robot">
|
||||||
|
<outputPath>reports/robot</outputPath>
|
||||||
|
<logFileLink/>
|
||||||
|
<reportFileName>report.html</reportFileName>
|
||||||
|
<logFileName>log.html</logFileName>
|
||||||
|
<outputFileName>output.xml</outputFileName>
|
||||||
|
<passThreshold>0.0</passThreshold>
|
||||||
|
<unstableThreshold>0.0</unstableThreshold>
|
||||||
|
<onlyCritical>true</onlyCritical>
|
||||||
|
<enableCache>true</enableCache>
|
||||||
|
<otherFiles/>
|
||||||
|
<disableArchiveOutput>false</disableArchiveOutput>
|
||||||
|
</hudson.plugins.robot.RobotPublisher>
|
||||||
|
</publishers>
|
||||||
|
</project>
|
3
tests/publishers/fixtures/robot-minimal.yaml
Normal file
3
tests/publishers/fixtures/robot-minimal.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
publishers:
|
||||||
|
- robot:
|
||||||
|
output-path: reports/robot
|
Loading…
x
Reference in New Issue
Block a user