summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jeanson <mjeanson@gmail.com>2017-12-14 16:21:15 -0500
committerMichael Jeanson <mjeanson@gmail.com>2017-12-14 16:36:01 -0500
commite0eb05d7ef2f53718aeb7b8320ff60b760154684 (patch)
tree24e085ee390957ee4d2c1b9d00a49adb6d09ee0b
parentc4aab5c22d3f2834d204fae9bf01f095f2739c31 (diff)
downloadpython-jenkins-job-builder-e0eb05d7ef2f53718aeb7b8320ff60b760154684.tar.gz
python-jenkins-job-builder-e0eb05d7ef2f53718aeb7b8320ff60b760154684.tar.xz
python-jenkins-job-builder-e0eb05d7ef2f53718aeb7b8320ff60b760154684.zip
Add messages and categories ignores to warnings publisher
Change-Id: I97aa2a92643ba0f654f3c01557bf9cb8713911ad Signed-off-by: Michael Jeanson <mjeanson@gmail.com>
-rw-r--r--jenkins_jobs/modules/publishers.py10
-rw-r--r--tests/publishers/fixtures/warnings-full.xml4
-rw-r--r--tests/publishers/fixtures/warnings-full.yaml6
-rw-r--r--tests/publishers/fixtures/warnings-minimal.xml2
4 files changed, 22 insertions, 0 deletions
diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index 407674d1..59cb8911 100644
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -3793,6 +3793,14 @@ def warnings(registry, xml_parent, data):
:arg str files-to-ignore: Comma separated list of regular expressions
that specifies the files to exclude from the report (based on their
absolute filename). (default '')
+ :arg str messages-to-ignore: Newline separated list of regular
+ expressions that specifies the warning messages to exclude form the
+ report (based on the warning messages). By default all warning
+ messages are included
+ :arg str categories-to-ignore: Newline separated list of regular
+ expressions that specifies the warning messages to exclude form the
+ report (based on the warning categories). By default all warning
+ categories are included
:arg bool run-always: By default, this plug-in runs only for stable or
unstable builds, but not for failed builds. Set to true if the
plug-in should run even for failed builds. (default false)
@@ -3914,6 +3922,8 @@ def warnings(registry, xml_parent, data):
warnings_mappings = [
('files-to-include', 'includePattern', ''),
('files-to-ignore', 'excludePattern', ''),
+ ('messages-to-ignore', 'messagesPattern', ''),
+ ('categories-to-ignore', 'categoriesPattern', ''),
('plugin-name', 'pluginName', '[WARNINGS]'),
('run-always', 'canRunOnFailed', False),
('detect-modules', 'shouldDetectModules', False),
diff --git a/tests/publishers/fixtures/warnings-full.xml b/tests/publishers/fixtures/warnings-full.xml
index d3bfc473..309afac4 100644
--- a/tests/publishers/fixtures/warnings-full.xml
+++ b/tests/publishers/fixtures/warnings-full.xml
@@ -22,6 +22,10 @@
</parserConfigurations>
<includePattern>[a-zA-Z]\.java,[a-zA-Z]\.cpp</includePattern>
<excludePattern>[a-zA-Z]\.html,[a-zA-Z]\.js</excludePattern>
+ <messagesPattern>^Test results:.*
+No sources found skipping Kotlin compile</messagesPattern>
+ <categoriesPattern>WARN.*
+ERROR</categoriesPattern>
<pluginName>[WARNINGS]</pluginName>
<canRunOnFailed>true</canRunOnFailed>
<shouldDetectModules>true</shouldDetectModules>
diff --git a/tests/publishers/fixtures/warnings-full.yaml b/tests/publishers/fixtures/warnings-full.yaml
index 17d005d6..43710b7e 100644
--- a/tests/publishers/fixtures/warnings-full.yaml
+++ b/tests/publishers/fixtures/warnings-full.yaml
@@ -10,6 +10,12 @@ publishers:
scanner: FxCop
files-to-include: '[a-zA-Z]\.java,[a-zA-Z]\.cpp'
files-to-ignore: '[a-zA-Z]\.html,[a-zA-Z]\.js'
+ messages-to-ignore: |-
+ ^Test results:.*
+ No sources found skipping Kotlin compile
+ categories-to-ignore: |-
+ WARN.*
+ ERROR
run-always: true
detect-modules: true
resolve-relative-paths: true
diff --git a/tests/publishers/fixtures/warnings-minimal.xml b/tests/publishers/fixtures/warnings-minimal.xml
index e26b4f51..6702e2a3 100644
--- a/tests/publishers/fixtures/warnings-minimal.xml
+++ b/tests/publishers/fixtures/warnings-minimal.xml
@@ -6,6 +6,8 @@
<parserConfigurations/>
<includePattern/>
<excludePattern/>
+ <messagesPattern/>
+ <categoriesPattern/>
<pluginName>[WARNINGS]</pluginName>
<canRunOnFailed>false</canRunOnFailed>
<shouldDetectModules>false</shouldDetectModules>