强制TFS2010工作流程构建失败,而不是部分地SUCCEED [英] Forcing a TFS2010 workflow build to FAIL instead of PARTIALLY SUCCEED

查看:115
本文介绍了强制TFS2010工作流程构建失败,而不是部分地SUCCEED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个自定义工作流活动运行外部程序,该解决方案已成功编译后,即返回退出$ C $℃下> 0,如果外部进程已经失败。有一次,我知道这个过程已经失败,我想设置生成的状态设置为失败(因为你会看到,如果code有没有编译),所以我加了SetBuildProperties活动,将设置状态属性BuildStatus.Failed但这似乎只导致给人当构建完成了部分成功构建。

I currently have a custom workflow activity to run an external process, after the solution has been compiled successfully, that returns an ExitCode <> 0 if the external process has failed. Once I know that the process has failed, I want to set the build status to FAIL (as you would see if code has not compiled) so I have added a SetBuildProperties activity which will set the Status property to BuildStatus.Failed but this only seems to result in giving a Partially Succeeded build when the build is finished.

我曾尝试构建的编辑状态设置为它确实导致无法建立自己的自定义活动里失败了,但我真的不希望有这样做,因为它是当溶液编译误导。

I have tried setting the build's compilation status to failed inside my custom activity which does result in a Failed build, but I don't really want to have to do that as it is misleading when the solution has compiled.

谁能告诉我怎么可以强制生成失败? (preferably而无需设置编译状态失败!)

Can anyone tell me how I can force a build to fail?? (preferably without having to set the compilation status to failed!)

感谢

推荐答案

这里发生了什么是,当构建完成后,工作流管理器将覆盖构建状态取决于构建过程的状态组合的值。在你的情况下,CompilationStatus是成功了,但有一个自定义活动失败(您将BuildStatus失败),所以整体状态将PartiallySucceeded。

What happened here is that when the build finishes, the workflow manager will overwrite the build status to a value that depends on the combination of statuses of the build process. In your case, the CompilationStatus is Succeeded, but there is a custom activity failure (you set the BuildStatus to Failed), so the overall status would be PartiallySucceeded.

这里唯一的解决方法是设置为CompilationStatus失败或未知,那么生成的状态会失败。

The only workaround here is to set the CompilationStatus to either Failed or Unknown, then the build status will be Failed.

我没有尝试过的CompilationStatus虽然设置为未知。但是,如果这是可以做到,以后可以回去,并更改为通过。仅仅是一种与真正的编译失败来区分的基础之上。

I haven't tried setting the CompilationStatus to Unknown though. But if it can be done, you can later go back and change it to Passed. Just a way to distinguish with the real failed compilation builds.

不是一个伟大的解决办法,我知道:(

Not a great workaround, I know :(

更新:使用SetBuildProperties活动设置生成状态失败,我能失败,即使编译成功构建

UPDATE: Using SetBuildProperties activity to set the build status to Failed and I was able to fail the build even though the compilation succeeded.

这篇关于强制TFS2010工作流程构建失败,而不是部分地SUCCEED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆