Merge "Update Logfilesizechecker to use convert xml"

This commit is contained in:
Jenkins 2016-07-19 17:08:12 +00:00 committed by Gerrit Code Review
commit 8524c041af
7 changed files with 17 additions and 18 deletions

View File

@ -225,26 +225,25 @@ def logfilesize(parser, xml_parent, data):
:arg int size: Abort the build if logfile size is bigger than this
value (in MiB, default 128). Only applies if set-own is true.
Minimum config example:
Full Example:
.. literalinclude:: /../../tests/wrappers/fixtures/logfilesize002.yaml
.. literalinclude:: /../../tests/wrappers/fixtures/logfilesize-full.yaml
Full config example:
.. literalinclude:: /../../tests/wrappers/fixtures/logfilesize001.yaml
Minimal Example:
.. literalinclude:: /../../tests/wrappers/fixtures/logfilesize-minimal.yaml
"""
lfswrapper = XML.SubElement(xml_parent,
'hudson.plugins.logfilesizechecker.'
'LogfilesizecheckerWrapper')
lfswrapper.set("plugin", "logfilesizechecker")
XML.SubElement(lfswrapper, 'setOwn').text = str(
data.get('set-own', 'false')).lower()
XML.SubElement(lfswrapper, 'maxLogSize').text = str(
data.get('size', '128')).lower()
XML.SubElement(lfswrapper, 'failBuild').text = str(
data.get('fail', 'false')).lower()
mapping = [
('set-own', 'setOwn', False),
('size', 'maxLogSize', 128),
('fail', 'failBuild', False),
]
convert_mapping_to_xml(lfswrapper, data, mapping, fail_required=True)
def timeout(parser, xml_parent, data):

View File

@ -3,8 +3,8 @@
<buildWrappers>
<hudson.plugins.logfilesizechecker.LogfilesizecheckerWrapper plugin="logfilesizechecker">
<setOwn>true</setOwn>
<maxLogSize>2048</maxLogSize>
<failBuild>false</failBuild>
<maxLogSize>1024</maxLogSize>
<failBuild>true</failBuild>
</hudson.plugins.logfilesizechecker.LogfilesizecheckerWrapper>
</buildWrappers>
</project>

View File

@ -1,4 +1,5 @@
wrappers:
- logfilesize:
set-own: true
size: 2048
size: 1024
fail: true

View File

@ -3,8 +3,8 @@
<buildWrappers>
<hudson.plugins.logfilesizechecker.LogfilesizecheckerWrapper plugin="logfilesizechecker">
<setOwn>true</setOwn>
<maxLogSize>1024</maxLogSize>
<failBuild>true</failBuild>
<maxLogSize>2048</maxLogSize>
<failBuild>false</failBuild>
</hudson.plugins.logfilesizechecker.LogfilesizecheckerWrapper>
</buildWrappers>
</project>

View File

@ -1,5 +1,4 @@
wrappers:
- logfilesize:
set-own: true
size: 1024
fail: true
size: 2048