diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 0878724a2..3a185b8f0 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -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() diff --git a/tests/publishers/fixtures/plot005.xml b/tests/publishers/fixtures/plot005.xml new file mode 100644 index 000000000..071c7d97d --- /dev/null +++ b/tests/publishers/fixtures/plot005.xml @@ -0,0 +1,36 @@ + + + + + + + Sample graph + + persisted.csv + + + data.csv + INCLUDE_BY_STRING + Column 1,Column 2,Column 3 + + Column 1 + Column 2 + Column 3 + + + false + csv + + + bench + false + false + false + false + + + + + + + diff --git a/tests/publishers/fixtures/plot005.yaml b/tests/publishers/fixtures/plot005.yaml new file mode 100644 index 000000000..f1e3f4dfa --- /dev/null +++ b/tests/publishers/fixtures/plot005.yaml @@ -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'