Update xvnc to use convert xml

- Update doc to use 4 space indent syntax
- Update test file to be more descriptive
- Add minimal test
- Add plugin="xvnc" attribute

Change-Id: I6b669d3b18fd6efadcbaf1b801242a46d9c2db21
Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
Kien Ha 2016-07-22 12:37:29 -04:00
parent 49be71864a
commit 9746bddc48
5 changed files with 29 additions and 11 deletions

View File

@ -1819,22 +1819,29 @@ def xvnc(parser, xml_parent, data):
Enable xvnc during the build.
Requires the Jenkins :jenkins-wiki:`xvnc plugin <Xvnc+Plugin>`.
:arg bool screenshot: Take screenshot upon build completion
(default false)
:arg bool xauthority: Create a dedicated Xauthority file per build
(default true)
:arg bool screenshot: Take screenshot upon build completion (default false)
:arg bool xauthority: Create a dedicated Xauthority file per build (default
true)
Example:
Full Example:
.. literalinclude:: /../../tests/wrappers/fixtures/xvnc001.yaml
.. literalinclude:: /../../tests/wrappers/fixtures/xvnc-full.yaml
:language: yaml
Minimal Example:
.. literalinclude:: /../../tests/wrappers/fixtures/xvnc-minimal.yaml
:language: yaml
"""
xwrapper = XML.SubElement(xml_parent,
'hudson.plugins.xvnc.Xvnc')
XML.SubElement(xwrapper, 'takeScreenshot').text = str(
data.get('screenshot', False)).lower()
XML.SubElement(xwrapper, 'useXauthority').text = str(
data.get('xauthority', True)).lower()
xwrapper.set('plugin', 'xvnc')
mapping = [
('screenshot', 'takeScreenshot', False),
('xauthority', 'useXauthority', True),
]
convert_mapping_to_xml(xwrapper, data, mapping, fail_required=True)
def job_log_logger(parser, xml_parent, data):

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers>
<hudson.plugins.xvnc.Xvnc>
<hudson.plugins.xvnc.Xvnc plugin="xvnc">
<takeScreenshot>true</takeScreenshot>
<useXauthority>false</useXauthority>
</hudson.plugins.xvnc.Xvnc>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers>
<hudson.plugins.xvnc.Xvnc plugin="xvnc">
<takeScreenshot>false</takeScreenshot>
<useXauthority>true</useXauthority>
</hudson.plugins.xvnc.Xvnc>
</buildWrappers>
</project>

View File

@ -0,0 +1,2 @@
wrappers:
- xvnc