From e6714f92af6493619dcb483241d39c07447fa793 Mon Sep 17 00:00:00 2001 From: Somay Jain Date: Sat, 6 Jun 2015 01:00:27 +0530 Subject: [PATCH] Support for more configurable options in Plots Plugin * Added support for excluding default zero value from yaxis * Added support for using logarithmic scale in the yaxis Change-Id: Ie489a7dd934c6191add6e7108a510aac93d52f48 --- jenkins_jobs/modules/publishers.py | 13 ++++++++++++- tests/publishers/fixtures/plot001.xml | 2 ++ tests/publishers/fixtures/plot002.xml | 2 ++ tests/publishers/fixtures/plot003.xml | 2 ++ tests/publishers/fixtures/plot004.xml | 4 ++++ tests/publishers/fixtures/plot004.yaml | 2 ++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index e39485731..3764dbeb0 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -3064,7 +3064,14 @@ def plot(parser, xml_parent, data): descriptions used as X-axis labels and the build number and date used for tooltips. (default: False) - :arg bool keep-records: When checked, show all builds up to 'Number of + :arg bool exclude-zero-yaxis: When false, Y-axis contains the value zero + even if it is not included in the data + series. When true, the value zero is not + automatically included. (default: False) + :arg bool logarithmic-yaxis: When true, the Y-axis will use a logarithmic + scale. By default, the Y-axis uses a linear + scale. (default: False) + :arg bool keep-records: When true, show all builds up to 'Number of builds to include'. (default: false) :arg str csv-file-name: Use for choosing the file name in which the data will be persisted. If none specified and random @@ -3167,6 +3174,10 @@ def plot(parser, xml_parent, data): 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', '') diff --git a/tests/publishers/fixtures/plot001.xml b/tests/publishers/fixtures/plot001.xml index 73554993f..88fbda0fd 100644 --- a/tests/publishers/fixtures/plot001.xml +++ b/tests/publishers/fixtures/plot001.xml @@ -19,6 +19,8 @@ bench false + false + false true diff --git a/tests/publishers/fixtures/plot002.xml b/tests/publishers/fixtures/plot002.xml index fffd6b081..e0c336b1b 100644 --- a/tests/publishers/fixtures/plot002.xml +++ b/tests/publishers/fixtures/plot002.xml @@ -16,6 +16,8 @@ bench false + false + false false diff --git a/tests/publishers/fixtures/plot003.xml b/tests/publishers/fixtures/plot003.xml index 4c6459082..89a574a2d 100644 --- a/tests/publishers/fixtures/plot003.xml +++ b/tests/publishers/fixtures/plot003.xml @@ -18,6 +18,8 @@ bench false + false + false false diff --git a/tests/publishers/fixtures/plot004.xml b/tests/publishers/fixtures/plot004.xml index ac526fd90..b2a6b016f 100644 --- a/tests/publishers/fixtures/plot004.xml +++ b/tests/publishers/fixtures/plot004.xml @@ -24,6 +24,8 @@ PlotGroup false + true + true false @@ -43,6 +45,8 @@ PlotGroup false + false + false false diff --git a/tests/publishers/fixtures/plot004.yaml b/tests/publishers/fixtures/plot004.yaml index 2e16c8d18..ab36880a9 100644 --- a/tests/publishers/fixtures/plot004.yaml +++ b/tests/publishers/fixtures/plot004.yaml @@ -6,6 +6,8 @@ publishers: group: PlotGroup num-builds: '' style: line + exclude-zero-yaxis: true + logarithmic-yaxis: true use-description: false series: - file: graph-me-second.properties