Fail a build if tests fail

Published on
1 minute read

It took me longer than I thought it would to find this, but is you are using TFS2008 and you want builds to fail if any of the tests fail then you can add the following to the tests properties group in your build project (TFSBuild.prof)

<PropertyGroup>
  <!-- TEST ARGUMENTS
   If the RunTest property is set to true, then particular tests within a
   metadata file or test container may be specified here.  This is
   equivalent to the /test switch on mstest.exe.

   <TestNames>BVT;HighPriority</TestNames>
  -->
  <TreatTestFailureAsBuildFailure>true</TreatTestFailureAsBuildFailure>
</PropertyGroup>

Very handy…

Technorati Tags: TFBS    ALM    TFS 2008 

Practical Techniques and Tooling Software Development Automated Testing Continuous Integration Technical Mastery Technical Excellence Install and Configuration Azure Pipelines Troubleshooting Azure DevOps

Related blog posts

No related videos found.

Connect with Martin Hinshelwood

If you've made it this far, it's worth connecting with our principal consultant and coach, Martin Hinshelwood, for a 30-minute 'ask me anything' call.

Our Happy Clients​

We partner with businesses across diverse industries, including finance, insurance, healthcare, pharmaceuticals, technology, engineering, transportation, hospitality, entertainment, legal, government, and military sectors.​

Bistech Logo
SuperControl Logo
Xceptor - Process and Data Automation Logo
Lockheed Martin Logo
Akaditi Logo
Illumina Logo
Flowmaster (a Mentor Graphics Company) Logo
Deliotte Logo
Genus Breeding Ltd Logo
Emerson Process Management Logo
Boxit Document Solutions Logo
Big Data for Humans Logo
Cognizant Microsoft Business Group (MBG) Logo
Milliman Logo
Graham & Brown Logo
Workday Logo
Kongsberg Maritime Logo
Higher Education Statistics Agency Logo
New Hampshire Supreme Court Logo
Royal Air Force Logo
Department of Work and Pensions (UK) Logo
Nottingham County Council Logo
Washington Department of Enterprise Services Logo
Ghana Police Service Logo
Sage Logo
DFDS Logo
MacDonald Humfrey (Automation) Ltd. Logo
ALS Life Sciences Logo
Milliman Logo
Lean SA Logo