Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Running a script using the Script plugin reports all standard out as errors in bamboo log

Marc Eiler June 18, 2014

When I run a script in Bamboo using the Script plugin, all of the standard out from the script is reported as an error in the Bamboo log ang is reported in the Error Summary. Is there a way to get it to ignor standard out for logging? I even tried to redirect the std.out to a file to see if I could hide it, but that didn't work. The script that I'm running is nosetests with the xunit output parameter. Here's a sample of the standard out that I get that it shows an error:

----------------------------------------------------------------------
Ran 0 tests in 0.088s

OK

Shows like this in the log:

error	18-Jun-2014 11:44:30	
error	18-Jun-2014 11:44:30	----------------------------------------------------------------------
error	18-Jun-2014 11:44:30	Ran 0 tests in 0.088s
error	18-Jun-2014 11:44:30	
error	18-Jun-2014 11:44:30	OK

2 answers

1 accepted

0 votes
Answer accepted
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 18, 2014

Hi Marc,

Thank you for your question.

There are a few things I would suggest you on doing:

nosetest p1.py > text.txt 2>&1

Or

nosetests --processes 4 &> output.txt

nosetests --with-xunit --xunit-file=test_output.xml

Or

The option to make it as quiet as possible (-q for all of them)
The option to turn off output capture (-s works for both pytest and nose, not needed for unittest)

nosetests -q -s test_fixtures:TestSkip

Kind regards,
Rafael

Marc Eiler June 18, 2014

The first option worked great. It still confuses me as to *why* a standard out print statement is interpreted as an error in Bamboo. Shouldn't it me more of an informational item and not an error?

0 votes
Gretchen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 8, 2014

You can always specify what results are successful and what are failures. I've got another post on here somewhere where I go into some detail on how to structure that. My examples are based on the documentation for error levels on robocopy which you can google and find. Robocopy always returns a non-zero return code which is only a "failure" when the number is above 7. So when you script with that you have to force the return to 0 so that the build task reads as successful. As long as you can test for success or failure in your script you can return 0 or return (non-zero) and force the script to succeed or fail based on your criteria instead of the default.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events