TFS Gated check-in — How to reject check-in on Par

2019-06-25 13:15发布

问题:

I have a post-build script (powershell) which throws an exception, as expected. The post-build script is defined in the build definition in the 'Post-build script path' section. The exception is logged in the 'Other Errors and Warnings' section of the build.

With gated check-in turned on changes are still committed even though the build is classed as 'partial' (because the post build script failed).

It seems that commits are only rejected if MSBuild fails or the unit tests fail.

How can I reject any commits on a partial build result?

回答1:

You can modify the build template to implement a different logic, if you don't like it: see How to change Partially Succeeded build to Succeeded in TFS 2010.