Update xvfb to use convert xml
- Update docs to 4 space indent syntax - Fix doc 'display-name-offset' from str to int - Update doc options to have default values - Rename test files to be descriptive Change-Id: Ie8588c90ed24608d860d5f948be3980c715186ec Signed-off-by: Kien Ha <kienha9922@gmail.com>
This commit is contained in:
parent
49be71864a
commit
b78f661fc0
@ -1863,60 +1863,55 @@ def xvfb(parser, xml_parent, data):
|
||||
Enable xvfb during the build.
|
||||
Requires the Jenkins :jenkins-wiki:`Xvfb Plugin <Xvfb+Plugin>`.
|
||||
|
||||
:arg str installation-name: The name of the Xvfb tool instalation
|
||||
(default default)
|
||||
:arg str installation-name: The name of the Xvfb tool instalation (default
|
||||
'default')
|
||||
:arg bool auto-display-name: Uses the -displayfd option of Xvfb by which it
|
||||
chooses it's own display name
|
||||
(default false)
|
||||
chooses it's own display name (default false)
|
||||
:arg str display-name: Ordinal of the display Xvfb will be running on, if
|
||||
left empty choosen based on current build executor
|
||||
number (optional)
|
||||
left empty choosen based on current build executor number (default '')
|
||||
:arg str assigned-labels: If you want to start Xvfb only on specific nodes
|
||||
specify its name or label (optional)
|
||||
specify its name or label (default '')
|
||||
:arg bool parallel-build: When running multiple Jenkins nodes on the same
|
||||
machine this setting influences the display
|
||||
number generation (default false)
|
||||
machine this setting influences the display number generation (default
|
||||
false)
|
||||
:arg int timeout: A timeout of given seconds to wait before returning
|
||||
control to the job (default 0)
|
||||
:arg str screen: Resolution and color depth. (default 1024x768x24)
|
||||
:arg str display-name-offset: Offset for display names. (default 1)
|
||||
control to the job (default 0)
|
||||
:arg str screen: Resolution and color depth. (default '1024x768x24')
|
||||
:arg int display-name-offset: Offset for display names. (default 1)
|
||||
:arg str additional-options: Additional options to be added with the
|
||||
options above to the Xvfb command line
|
||||
(optional)
|
||||
options above to the Xvfb command line (default '')
|
||||
:arg bool debug: If Xvfb output should appear in console log of this job
|
||||
(default false)
|
||||
(default false)
|
||||
:arg bool shutdown-with-build: Should the display be kept until the whole
|
||||
job ends (default false)
|
||||
job ends (default false)
|
||||
|
||||
Example:
|
||||
Full Example:
|
||||
|
||||
.. literalinclude:: /../../tests/wrappers/fixtures/xvfb001.yaml
|
||||
.. literalinclude:: /../../tests/wrappers/fixtures/xvfb-full.yaml
|
||||
:language: yaml
|
||||
|
||||
Minimal Example:
|
||||
|
||||
.. literalinclude:: /../../tests/wrappers/fixtures/xvfb-minimal.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
xwrapper = XML.SubElement(xml_parent,
|
||||
'org.jenkinsci.plugins.xvfb.XvfbBuildWrapper')
|
||||
XML.SubElement(xwrapper, 'installationName').text = str(data.get(
|
||||
'installation-name', 'default'))
|
||||
XML.SubElement(xwrapper, 'autoDisplayName').text = str(data.get(
|
||||
'auto-display-name', False)).lower()
|
||||
if 'display-name' in data:
|
||||
XML.SubElement(xwrapper, 'displayName').text = str(data.get(
|
||||
'display-name', ''))
|
||||
XML.SubElement(xwrapper, 'assignedLabels').text = str(data.get(
|
||||
'assigned-labels', ''))
|
||||
XML.SubElement(xwrapper, 'parallelBuild').text = str(data.get(
|
||||
'parallel-build', False)).lower()
|
||||
XML.SubElement(xwrapper, 'timeout').text = str(data.get('timeout', '0'))
|
||||
XML.SubElement(xwrapper, 'screen').text = str(data.get(
|
||||
'screen', '1024x768x24'))
|
||||
XML.SubElement(xwrapper, 'displayNameOffset').text = str(data.get(
|
||||
'display-name-offset', '1'))
|
||||
XML.SubElement(xwrapper, 'additionalOptions').text = str(data.get(
|
||||
'additional-options', ''))
|
||||
XML.SubElement(xwrapper, 'debug').text = str(data.get(
|
||||
'debug', False)).lower()
|
||||
XML.SubElement(xwrapper, 'shutdownWithBuild').text = str(data.get(
|
||||
'shutdown-with-build', False)).lower()
|
||||
|
||||
mapping = [
|
||||
('installation-name', 'installationName', 'default'),
|
||||
('auto-display-name', 'autoDisplayName', False),
|
||||
('display-name', 'displayName', ''),
|
||||
('assigned-labels', 'assignedLabels', ''),
|
||||
('parallel-build', 'parallelBuild', False),
|
||||
('timeout', 'timeout', 0),
|
||||
('screen', 'screen', '1024x768x24'),
|
||||
('display-name-offset', 'displayNameOffset', 1),
|
||||
('additional-options', 'additionalOptions', ''),
|
||||
('debug', 'debug', False),
|
||||
('shutdown-with-build', 'shutdownWithBuild', False),
|
||||
]
|
||||
convert_mapping_to_xml(xwrapper, data, mapping, fail_required=True)
|
||||
|
||||
|
||||
def android_emulator(parser, xml_parent, data):
|
||||
|
@ -4,6 +4,7 @@
|
||||
<org.jenkinsci.plugins.xvfb.XvfbBuildWrapper>
|
||||
<installationName>default</installationName>
|
||||
<autoDisplayName>false</autoDisplayName>
|
||||
<displayName/>
|
||||
<assignedLabels/>
|
||||
<parallelBuild>false</parallelBuild>
|
||||
<timeout>0</timeout>
|
Loading…
Reference in New Issue
Block a user