From e195f7d21672590e322908e1261332082ea69a04 Mon Sep 17 00:00:00 2001 From: Kien Ha Date: Thu, 12 May 2016 11:32:38 -0400 Subject: [PATCH] Update Plot plugin - group parameter is required - add default to parameter yaxis documentation Change-Id: I14995b20f9fa9cec8cd38043269b5f290c1b5cbe Signed-off-by: Kien Ha --- jenkins_jobs/modules/publishers.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index c1b721dad..9e2a6ee32 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -3571,10 +3571,9 @@ def plot(parser, xml_parent, data): Requires the Jenkins :jenkins-wiki:`Plot Plugin `. - :arg str title: title for the graph - (default: '') - :arg str yaxis: title of Y axis - :arg str group: name of the group to which the plot belongs + :arg str title: title for the graph (default: '') + :arg str yaxis: title of Y axis (default: '') + :arg str group: name of the group to which the plot belongs (required) :arg int num-builds: number of builds to plot across (default: plot all builds) :arg str style: Specifies the graph style of the plot @@ -3705,16 +3704,16 @@ def plot(parser, xml_parent, data): XML.SubElement(subserie, 'nodeTypeString').text = \ xpath_dict.get(xpathtype) XML.SubElement(subserie, 'fileType').text = serie.get('format') - XML.SubElement(plugin, 'group').text = plot['group'] - XML.SubElement(plugin, 'useDescr').text = \ - str(plot.get('use-description', False)).lower() - XML.SubElement(plugin, 'exclZero').text = \ - str(plot.get('exclude-zero-yaxis', False)).lower() - XML.SubElement(plugin, 'logarithmic').text = \ - str(plot.get('logarithmic-yaxis', False)).lower() - XML.SubElement(plugin, 'keepRecords').text = \ - str(plot.get('keep-records', False)).lower() - XML.SubElement(plugin, 'numBuilds').text = plot.get('num-builds', '') + + mappings = [ + ('group', 'group', None), + ('use-description', 'useDescr', False), + ('exclude-zero-yaxis', 'exclZero', False), + ('logarithmic-yaxis', 'logarithmic', False), + ('keep-records', 'keepRecords', False), + ('num-builds', 'numBuilds', '')] + convert_mapping_to_xml(plugin, plot, mappings, fail_required=True) + style_list = ['area', 'bar', 'bar3d', 'line', 'line3d', 'stackedArea', 'stackedbar', 'stackedbar3d', 'waterfall'] style = plot.get('style', 'line')