0

We have gated check-ins with our build. Sometimes the builds are orange or red. When they're red, the changeset is rejected and not committed. When the build for the check-in is orange, the check-in is not rejected and instead committed. How do we configured TFS to not check-in a changeset that produces an orange build result?

I don't care about the reason for the orange. I just want to reject the check-in no matter what.

enter image description here

core
  • 32,451
  • 45
  • 138
  • 193

1 Answers1

2

You need to determine why the build is going orange and then decide if that is reason enough to fail the build.

For a CI build you should satisfy these 2 as a minimum

  1. The Code Compiles without Errors (or warnings)
  2. All Unit Tests Pass

Your question doesn't specify why your builds are actually partially succeeding.

If your unit tests aren't successful then you can tick the fail build box in the test window BuildDefinition > Process > Test > Test Dialogue

enter image description here

if you want to custom fail the build you can add a SetBuildProperties to your workflow, within the build template

you can then choose which part of the build you want to fail, Status, or Test status.

This is an example of how I set Partially succeeded if the Code Coverage isn't high enough, but it shows the important parts

enter image description here

Just TFS
  • 4,697
  • 1
  • 18
  • 22