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:
parent
49be71864a
commit
9746bddc48
@ -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):
|
||||
|
@ -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>
|
9
tests/wrappers/fixtures/xvnc-minimal.xml
Normal file
9
tests/wrappers/fixtures/xvnc-minimal.xml
Normal 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>
|
2
tests/wrappers/fixtures/xvnc-minimal.yaml
Normal file
2
tests/wrappers/fixtures/xvnc-minimal.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
wrappers:
|
||||
- xvnc
|
Loading…
Reference in New Issue
Block a user