The Analyzer step would: [list]
1. Scan all previously finished steps in a build
2. Identify any that have failed
3. Get the complete log for the failed steps
4. Retrieve a list of Regex's from a Database
5. Run each regex over the log file to identify known failure patterns.
6. If any of the regex's are found, use a format string and feed that information back to the step as an artifact.
[/list:u]
I can do everything in the list except for step 3. (Although I haven't tested 6 yet)
The problem I'm having is accessing the log output from a previously finished step doesn't seem to be possible within the context of a subsequent step.
I've tried several things to get my hands on the previous steps' logs all to no avail.
[list]
1. new BuildLog(build.id, step.path); stepLog.getTextInputStream("\n", true);[list]
even with byte by byte reading, the stream size is 0 and I never get anything from it.
(being an input stream, this doesn't surprise me)
I can get the name from the stepLog, so I know it's "there"[/list:u]
2. build.renderLogAsHtml(true) & build.renderLogAsText(true)[list]
Both produce 0-length strings.[/list:u]
3. build.getLogUrl(step.getName())[list]
The URL is generated, but attempts to access it come up with an error: Invalid step path: Test Failure[/list:u]
4. new BuildLog(build.id);[list]
The build log is empty as it's still "live".[/list:u]
5. DefaultLivelogManager.instance.getLiveLog(build.id, step.path, 0);[list]
Live logs are only available for the overall build, and the current step (The Analyzer).
All "finished" steps do not have a "live log" available to them.[/list:u]
6. build.getLogFile(); [list]
Errors with "The system cannot find the path specified" as the script is running on a node, not the master.[/list:u]
[/list:u]
The only interface I can't seem to exercise is: step.renderLogAsText[list]
It requires a "BuildLogEntry", which I can't find an interface to other than the LiveLog.[/list:u]
A little help, if you please!