Gerard Davison is a Senior Principal Software Engineer working at Oracle in the UK on SOAP and REST tooling. Currently he is contributing in the area of WADL generation and client generation in the Jersey project and is maintaining the Abbot swing automation project. He also maintain a small holding of Hudson nodes run all those tests. He graduated from the University of Reading with a degree in Human Cybernetic and can't help looking for feedback loops. Gerard is a DZone MVB and is not an employee of DZone and has posted 32 posts at DZone. You can read more from them at their website. View Full User Profile

Ignoring the Return Value of a Command in Hudson/Jenkins sh Task

06.03.2012
| 3860 views |
  • submit to reddit
So I was was trying to run pylint and nosetest running on a Jenkins instance; but these python commands tend to return a non zero status code if they see a non zero return code. This is a problem as it means that any further steps are ignored. The most obvious thing to try was this:

pylint src/openhea -f parseable ; true

The problem is that both statements are treated as separate steps so when the first one fails it never does the return true. Instead, and pointed out by a helpful chap in the #efdhack2012 room was to do the following

pylint src/openhea -f parseable || true

This correctly ignores the false status code, the only wrinkle is that you need to be careful when piping the output, it has to be to the left of the bars.

pylint src/openhea -f parseable > output.report || true
Published at DZone with permission of Gerard Davison, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Daniel Slazer replied on Tue, 2012/06/12 - 12:07pm

Putting here writeBuffer.write("@@\r\n\r\n"); the extra \r\n. Below is sample of proper data and its corresponding corrupted data. For each complete string we send this writeBuffer.write("@@\r\n\r\n"); as acknowledgment to the peer. The problem happens where is a bulk of data, but on normal transmission no corruption at all. IS there a buffer problem which causing the corruption? I have tried to read the line by line character and did not find anything after the *

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.