1

We have installed and enabled Jenkins' Warnings Plugin and, we are using it's Maven parser to detect warnings in the task execution log.

This plugin has a set of advanced options that are supposed to allow including and excluding certain files and messages:

Advanced plugin setup

We currently have several projects with some warnings that we'd like to exclude from this analysis, but we haven't been able to figure out the proper regex for them, like the ones in this example image:

Warnings sample

As regex, I've tried several approaches, but seems either Jenkins is expecting something special or maybe I'm just doing something wrong.

For this chunk, which is treated as a single warning:

[WARNING] Coverage measure for metric 'lines_to_cover' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'uncovered_lines' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'coverage_line_hits_data' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'conditions_to_cover' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'uncovered_conditions' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'conditions_by_line' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.
[WARNING] Coverage measure for metric 'covered_conditions_by_line' should not be saved directly by a Sensor. Plugin should be updated to use SensorContext::newCoverage instead.

I've tried several regexes like 'lines_to_cover' or '.lines_to_cover.' which both seem to work in an online test tool, but neither are being caught by Jenkins.

Any ideas on the regex for excluding such warnings?

closed as off-topic by c32hedge, alecxe Oct 28 '17 at 4:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development unrelated to testing are off-topic here, but can be asked on Stack Overflow." – c32hedge, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.

  • I think you'll get more/better answers on stackoverflow since this isn't really anything specific to testing. – c32hedge Oct 27 '17 at 21:24
  • @c32hedge Testing coverage is not specific to testing? Sorry, but I think I don't understand what you mean – gvasquez Oct 31 '17 at 18:47
  • 1
    The problems you are having are with regex and Jenkins plugins for handling compiler warnings. The fact that the content of what you're trying to capture using those plugins and regex happens to be about testing doesn't mean the technical issue itself is specific to testing. Not saying at all that you don't have a valid question--just that you'd likely get better help on SO. A mod may be able to migrate your question over there or it may happen automatically, not sure how that works. – c32hedge Oct 31 '17 at 20:00
  • @c32hedge partially true, as those are SonarQube warnings when pushing Coverage data from Cobertura reports, not exactly compiler warnings, but I see your point of view – gvasquez Oct 31 '17 at 20:26