Paul
Paul

Reputation: 1483

Can I Configure TFS builds to fail fast after n tests have failed

What I would like to do is fail and abort the TFS Build after, say 10 of the tests fail. I cannot see a parameter for this in the Build Definition.

Build Definition Settings (some values removed for privacy)

We have 1000's of Integration tests that get run as part of a nightly build. These tests take in the region of 1 hour to run hence only the nightly build runs these; the quicker unit tests are run as part of a CI build on every check-in.

When we have a failed build at night time, we'd like to re-run that build the following day, but abort as soon as there's 10 failed tests. This will save us time when tracking down the issues.

Ideally the tests shouldn't take so long but pragmatically we cannot resolve that in a short space of time.

Upvotes: 2

Views: 458

Answers (2)

Levent Sezer
Levent Sezer

Reputation: 611

You need to develop your own custom activity and use it on the build template for this purpose.

Upvotes: 0

Gertjan
Gertjan

Reputation: 41

As far as I know, this is not possible with TFS builds out-of-the-box. The default TFS build template runs all the tests identified in the build definition in one run, without the possibility to act on the results of individual tests. The only way to accomplish this as I see it is by customizing the default TFS build template to your needs and use this template for your build definition.

Upvotes: 1

Related Questions