Failing a build if a regex doesn't match is not working for me

Hi all,

I'm trying to fail a build if the log doesn't contain a match to a certain regex. However, when testing the regex against a finished build that should contain a match, it still says the build would've failed. The task is simple too, I just want to not depend on the number of blanks between the text and the colon. So either I'm missing something really obvious, or TC does something wrong.

This is the line I'm trying to match:

Additional defects, SpotBugs   : 0

This is my regex:

Additional defects, SpotBugs \s*: 0\n

Any ideas?

0
1 comment

Hello Johannes!

The regular expression seems to be correct. For such cases, it might help you to verify it as explain here:

https://www.jetbrains.com/help/idea/regular-expression-syntax-reference.html#tips-tricks

How are you accessing the log of the finished build and parsing these lines that you need? It might be that the problem you have is there.

If you want, share the screenshots of your build configuration and any sample files via our secure upload service, and share the id with us so that we try to help you here:

https://uploads.jetbrains.com/

Thank you,

Guilherme

0

Please sign in to leave a comment.