Plugin Information
Plugin ID |
text-finder |
Changes |
|
---|---|---|---|
Latest Release |
1.10 (archives) |
Source Code |
GitHub |
Usage |
|
Installations |
2016-Oct 6036 |
This plugin lets you search keywords in the files you specified and use that to downgrade a "successful" build to be unstable or a failure.
This is handy when you have some tools in your build chain that don't use the exit code properly.
The search is always performed, even on builds which returned a non-zero exit status, but the reclassification only applies to builds which returned an overall exit status of zero.
Change Log
Version 1.10 (Jan 31, 2014)
- No longer blocking concurrent builds. (JENKINS-17507)
- Cleaner config UI using help buttons
- Japanese translation
Version 1.9 (Feb 13, 2011)
- Update link in help
Version 1.8 (Feb 6, 2010)
- Update code for more recent Hudson
Version 1.7 (May 4, 2009)
- Fixed a file handle leak (JENKINS-3613)
Version 1.6 (Nov 6, 2008)
- Modified to work with all job types, including Maven2 jobs.
Version 1.5
- Added "Unstable if found" configuration option. Use this option to set build unstable instead of failing the build. Default is off (previous behavior).
11 Comments
Leo Hart
Does this support multi-line regex searches?
For instance, if the console had:
and I provided a regex of:
to get the output of hbm2dll.
Matt Joste
I've taken 8 years to think about this
, but I'm guessing not:
My case:
Target Text:
Regex:
This has no match, but I've tried in Java Regex testers online and 'The Regex Coach', and they all find a match.
But trying one line definitely works:
Unknown User (bazthemail@gmail.com)
Would you please provide an example on how to search multiple strings from the console log? For example, search for three keywords: "^Error:", "FATAL ERROR", and "ERRORE:". I tried and without succeed.
Unknown User (gunner_1980)
Does this have the ability to search for multiple regular expressions and return different results based off of them? From the looks of it you can only pass/fail or choose unstable based off of the searched. For example I would like to be able to fail the build if it finds one regular expression or show a build as unstable if it finds another. Right now it looks like it is all or nothing but it would be really nice to be able to specify a regex that would trigger a build fail and another regex that would trigger a build unstable. The fail would of course need to override any unstable regex's that are found.
Unknown User (fndaway)
I just added the plug to hudson 1.386
And check the following: "Hudson Text Finder" "Also search the console output" and"Unstable if found"
and I added as regex "BUILD_FAILED" w/o quotes. My test script it echoes "BUILD_FAILED" and I see the message in the console output,
However the jobs still is failed (red). I tried adding "BUILD_FAILED" with quotes and even ".*" w/o quotes and still fails.
Please help what I'm doing wrong.
<3
Unknown User (fndaway)
FYI: It seems that this plug in to work the exit code from the script must be 0.
My test.sh exited with 10, however I still want to set it as unstable when "BUILD_FAILED" on console.
Seems to me like even if the exit code is not zero the but the expression is found the plug-in should still work.
<3
Massimo Rossello
If a searched file does not exist, then this is always considered a failure: but this should be configurable.
For example, I wish to detect IF there are files with a specific name that contain the WARNING string, but if there are no such files all should be considered ok.
I only found the workaround to always generate an empty file during the build.
Thanks
William Roberts
The documentation for this plugin could be improved a lot - in particular, it would be very helpful if it said
"This plugin can be used to downgrade a successful build to "unstable" or "failure" if a regular expression matches in a set of files.
For example, it can be used to search for the string "failure" in a set of log files."
I have raised https://issues.jenkins-ci.org/browse/JENKINS-12512 to propose this more formally.
Miles Duke
The current description on this page seems to cover the points you make.
As designed, though, the capabilities seem to be limited though:
I would like to mark builds aborted in certain circumstances -- for instance when the necessary pre-conditions to perform a successful build have not been met. When we run our script, the only outcomes (without manual intervention) are failed, succeeded, or unstable, but we already have meaningful scenarios for these. We could just keep waiting, but then that means it would be a while for people to understand what is going on.
Mahesh Ramamurthy
Is it possbile to specify multiple files in "Files to Search". If so, how is this achieved.
Rakesh Dama
Jenkins Text Finder functionality is working but it is taking longer to read the console output.
I have no idea about the reason behind it. Could you suggest any.
Here's the the expression that I am using:
(?i)unstable*|.*(?i)completed. Result was FAILURE.*|.*(?i)[INFO] BUILD FAILURE*
Add Comment