提出问题提出问题
 

已答复Fail build when unit tests fail

  • 2009年3月3日 19:27Bob Yexley 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     包含代码
    We have created a custom build script that performs a ClickOnce deployment at the end of it. We've tried to create the deploy target in such a way that it only runs conditionally, but our condition doesn't seem to be working correctly, and I can't seem to figure out why. I'm hoping someone here can help shed some light on why.

    We've overridden the AfterEndToEndIteration target in the following way:

    <Target Name="AfterEndToEndIteration" Condition="'$(IsDesktopBuild)'!='true'">  
        <Message Text="TestStatus = $(TestStatus)" /> 
        <MSBuild Projects="$(MSBuildProjectFile)" Targets="Deploy" Condition="'$(TestStatus)'!='Failed'" /> 
    </Target> 

    For some reason, $(TestStatus) always seems to be set to "Unknown", whether unit tests succeed or fail. We've set the script to run unit tests simply by setting <RunTest>true</RunTest> in a PropertyGroup at the top of the script.

    Anyone have any ideas why this isn't working, or what we need to change to cause this build to fail and NOT run the deploy target when unit tests fail?

    YEX - http://yexley.net/bob/

答案

全部回复