[BUGFIX] Add missing "strExclusionSet" element when using "exclusionValues"
Otherwise a NullPointerException is thrown. Co-Authored By: Dong Ma <winterma.dong@gmail.com> Change-Id: I19435bc4af8265ad03754643b84d06189d6c5493 Story: 2000334
This commit is contained in:
parent
46bc9ecab5
commit
dff8339156
@ -3420,6 +3420,9 @@ def plot(parser, xml_parent, data):
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/plot004.yaml
|
||||
:language: yaml
|
||||
|
||||
.. literalinclude:: /../../tests/publishers/fixtures/plot005.yaml
|
||||
:language: yaml
|
||||
"""
|
||||
top = XML.SubElement(xml_parent, 'hudson.plugins.plot.PlotPublisher')
|
||||
plots = XML.SubElement(top, 'plots')
|
||||
@ -3462,6 +3465,12 @@ def plot(parser, xml_parent, data):
|
||||
inclusion_dict.get(inclusion_flag)
|
||||
XML.SubElement(subserie, 'exclusionValues').text = \
|
||||
serie.get('exclude', '')
|
||||
if serie.get('exclude', ''):
|
||||
exclude_strings = serie.get('exclude', '').split(',')
|
||||
exclusionset = XML.SubElement(subserie, 'strExclusionSet')
|
||||
for exclude_string in exclude_strings:
|
||||
XML.SubElement(exclusionset, 'string').text = \
|
||||
exclude_string
|
||||
XML.SubElement(subserie, 'url').text = serie.get('url', '')
|
||||
XML.SubElement(subserie, 'displayTableFlag').text = \
|
||||
str(plot.get('display-table', False)).lower()
|
||||
|
36
tests/publishers/fixtures/plot005.xml
Normal file
36
tests/publishers/fixtures/plot005.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<hudson.plugins.plot.PlotPublisher>
|
||||
<plots>
|
||||
<hudson.plugins.plot.Plot>
|
||||
<title>Sample graph</title>
|
||||
<yaxis/>
|
||||
<csvFileName>persisted.csv</csvFileName>
|
||||
<series>
|
||||
<hudson.plugins.plot.CSVSeries>
|
||||
<file>data.csv</file>
|
||||
<inclusionFlag>INCLUDE_BY_STRING</inclusionFlag>
|
||||
<exclusionValues>Column 1,Column 2,Column 3</exclusionValues>
|
||||
<strExclusionSet>
|
||||
<string>Column 1</string>
|
||||
<string>Column 2</string>
|
||||
<string>Column 3</string>
|
||||
</strExclusionSet>
|
||||
<url/>
|
||||
<displayTableFlag>false</displayTableFlag>
|
||||
<fileType>csv</fileType>
|
||||
</hudson.plugins.plot.CSVSeries>
|
||||
</series>
|
||||
<group>bench</group>
|
||||
<useDescr>false</useDescr>
|
||||
<exclZero>false</exclZero>
|
||||
<logarithmic>false</logarithmic>
|
||||
<keepRecords>false</keepRecords>
|
||||
<numBuilds/>
|
||||
<style>line</style>
|
||||
</hudson.plugins.plot.Plot>
|
||||
</plots>
|
||||
</hudson.plugins.plot.PlotPublisher>
|
||||
</publishers>
|
||||
</project>
|
14
tests/publishers/fixtures/plot005.yaml
Normal file
14
tests/publishers/fixtures/plot005.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
publishers:
|
||||
- plot:
|
||||
- title: 'Sample graph'
|
||||
yaxis: ''
|
||||
csv-file-name: 'persisted.csv'
|
||||
group: 'bench'
|
||||
numbuilds: '1'
|
||||
style: 'line'
|
||||
use-description: false
|
||||
series:
|
||||
- file: 'data.csv'
|
||||
format: 'csv'
|
||||
inclusion-flag: 'include-by-string'
|
||||
exclude: 'Column 1,Column 2,Column 3'
|
Loading…
Reference in New Issue
Block a user