Text-finder Plugin

Plugin Information

Plugin ID text-finder
Latest Release 1.8
Latest Release Date Feb 06, 2010
Sources Subversion
Support Eclipse Hudson Forum
Issue Tracking Eclipse Bugzilla

This plugin lets you search keywords in the files you specified and use that to mark the build as success or a failure.

This is handy when you have some tools in your build chain that doesn't use the exit code properly.

Change Log

Version 1.8 (Feb 6, 2010)
  • Update code for more recent Hudson
Verion 1.7 (May 4, 2009)
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).

Labels:

plugin-post-build plugin-post-build Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Oct 26, 2009

    Leo Hart says:

    Does this support multi-line regex searches? For instance, if the console had: ...

    Does this support multi-line regex searches?

    For instance, if the console had:

    [hibernatetool] 1. task: hbm2ddl (Generates database schema)
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    log4j:WARN Please initialize the log4j system properly.
    alter table account_statement_address add constraint FK612CAF92BE9E69AE foreign key (account_id) references account
    alter table account_statement_address add constraint FK612CAF9212A012FF foreign key (party_geographic_address_id) references party_geographic_address
    alter table statement_copy_addr add constraint FKBBB86BABBE9E69AE foreign key (account_id) references account
    alter table statement_copy_addr add constraint FKBBB86BAB12A012FF foreign key (party_geographic_address_id) references party_geographic_address
    [INFO] Executed tasks
    

    and I provided a regex of:

    log4j:WARN Please initialize the log4j system properly\.\n(.\|\n){1,}\[INFO\] Executed tasks
    

    to get the output of hbm2dll.

  2. Nov 04, 2009

    bazthemail says:

    Would you please provide an example on how to search multiple strings from the c...

    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.

  3. Oct 06, 2010

    Geoff Guenther says:

    Does this have the ability to search for multiple regular expressions and return...

    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.

  4. Jan 19, 2011

    fndaway says:

    I just added the plug to hudson 1.386 And check the following: "Hudson Text Fin...

    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

    1. Jan 19, 2011

      fndaway says:

      FYI:  It seems that this plug in to work the exit code from the script must...

      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

  5. Jun 24, 2011

    jos says:

    <UPDATE> The plugin will scan files line by line, therefor multiline sear...

    <UPDATE>
    The plugin will scan files line by line, therefor multiline searches cannot be done.
    The regex below is still a valid, just won;t work with this particular plugin.
    </UPDATE>

    I figured a - or maybe even the most frequent - use of the text-finder plugin would be to scan a - probably appended to - logfile for a string after the last occurence of an other. I also figured I'd share the love and post this example of a regex that would do that:

    (?s)(??:error)|(?:warning))(?!.*(??:startup)|(?:revival)))

    (those emoticons are pretty funny actually, given the Perlish gibberish regexes are, they are ':' plus '(' of course )

    To laymen, it looks for the occurrence of 'error' or 'warning' without 'startup' or 'revival' following it. Which is equivalent to 'error' or 'warning' after the last occurrence (if any) of either 'startup' or 'revival'. It covers multiple lines doing so.

    If you won't read the java.util.regex.Pattern docs:
    (?s) means DOTALL, aka '.' matches newlines too
    (?:X) means X is not stored and is not strictly necessary
    X(?!Y) means X not followed by Y and is called negative (the not-part) lookahead (the followed part).

    Does anybody have 'revival' in their logs?

    Cheers, Jos