Failing a build

I'm using psake and the Powershell runner in TC 6.5
I have a build with two steps, the first uses psake and the 2nd is NUnit (which is not really relevant here)
From the sake script I output         "##teamcity[buildStatus status='ERROR' text='Failed to build web applications' errorDetails='BuildWeb psake step failed']" if a step fails and in the build settings I have the "Fail build if  an error message is logged by build runner" checked.
However when I output the text the build carries on executing (i.e. the NUnit task executes) although the correct error message (Failed to build web applications) appears in the main UI.

Can I get the build to fail and stop after outputing the error message from within my build script?

Thanks,

Kevin Jones

2 comments
Comment actions Permalink

Anybody from JetBrains care to comment?



Thanks,

Kevin Jones
0
Comment actions Permalink

Kevin,

The next step does not execute only if previos step reports an error. For comamnd-line runner the only way to report an error is to return non-zero exit code and ensure that corresponding "fail build if"  option is turned on.

For the time being service messages, tests, etc. do not make the step fail (while failing the build in the end).

Seems that what you are asking is requested by TW-17015. Feel free to vote and detail your case/why workaround does not suit.

0

Please sign in to leave a comment.