What causes build steps to get skipped on failure?

I am working on setting up a number of different configurations with TeamCity and some of them have a lot of steps.  It seems like randomly sometimes if an earlier build step fails the later build steps will be skipped.  Sometimes, other build steps that are similar don't seem to get skipped, and execute regardless of previous build step failures.  What controls this?  Is there a setting somewhere for a given build step where I can say "continue despite failure" or "skip in event of failure"?

4 comments
Comment actions Permalink

Hello Justin,

If a build step fails (results the build to fial), no following steps run.

Here is a related feature to make the logic more flexible/configurable.

In your case, it can be either step "failures" that are not understood as such by TeamCity, conincedence that will not be proved if double-checked, or some magic.

0
Comment actions Permalink

Thanks Yegor.  I think I see the problem now.  The documentation you linked me to specifically says that the "stop if errors" behavior does not apply to the NUnit runner, which I am using.  Is there any way to override this behavior?  I have a step at the end of my process that creates deployment packages for the application.  I don't want those to be created if there are failed NUnit tests.  I suppose I could not use the NUnit runner and instead invoke NUnit through MSBuild or something and return a non-zero value from MSBuild but I'd rather not go to that extreme.

0
Comment actions Permalink

hi Justin,

Since "If you have enabled "Fail build if at least one test failed" condition in the General Settings of build configuration, TeamCity will continue executing build steps that go after test runner, but the build will be marked as failed", can you capture the TC variable holding failure status and pass it to the step where you do the deploy? This is a naive question based on just knowing there are variables; I'm not sure if there is one for this case. I'd like to use it too, later on, if so.  I had thought I could do that from reading the docs, but haven't tried it yet.

0
Comment actions Permalink

I guess that is the key.  Is there a variable kept around by TC that keep track of whether there have been test failures thus far in the execution?

0

Please sign in to leave a comment.