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
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.