Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have test job in Jenkins to mark build as Stable and NOT Unstable?

Currently I am building and testing my app in Jenkins. If a test fails in the job then the build is marked as Unstable. Is it possible to have the build be marked as Stable even though tests fail? The build is marked as Failed if code does not compile, and that is fine.

like image 419
user1340582 Avatar asked Feb 19 '23 07:02

user1340582


1 Answers

There is a plugin called Jenkins Text Finder:
https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin

It allows to search console log for regular expression matches, and if found, it can set the build to various states, including setting it as "success" (i.e. not unstable).

Just echo a unique label/line into your console output after the build is successful, and look for that line with this plugin. Use "Succeed if found" option in the plugin to mark build successful.

like image 145
Slav Avatar answered Feb 20 '23 21:02

Slav