English 中文(简体)
t custom custom custom custom
原标题:Can t make the TFS build fail after custom logic runs

我写出一些习俗逻辑,使联尼特测试进入TFS大楼。 除非试验没有穿过建筑,但部分成功而不是失败,否则所有工作都是美丽的。 任何人都知道我如何告诉它失败?

在座各位:

<BuildStep Message="Integration Tests Passed"
   Condition="$(TestsResult)  ==  True "
   TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
   BuildUri="$(BuildUri)"
   Id="$(IntegrationTestsStepId)"
   Status="Succeeded" />
<BuildStep Message="Integration Tests FAILED"
   Condition="$(TestsResult) !=  True "
   TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
   BuildUri="$(BuildUri)"
   Id="$(IntegrationTestsStepId)"
   Status="Failed"
   CompilationStatus="Failed"
   TestStatus="Failed"/>
<!-- If NUnit failed it s time to error out -->
<Error Condition="$(TestsResult) !=  True " Text="Unit Tests Failed" />
最佳回答

它是:

    <SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        CompilationStatus="Failed"
                        TestStatus="Failed"
                        Condition=" $(TestsResult)  !=  True ">
</SetBuildProperties>


<Error Condition=" $(TestsResult) != True " Text="Smoke Tests Failed" />
<SetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        CompilationStatus="Succeeded"
                        TestStatus="Succeeded"
                        Condition=" $(TestsResult)  !=  False ">
</SetBuildProperties>

我认为,必须发出CompilationStatus 试验Status的信号。

问题回答

这是在团队建设中单位测试的违约行为。 我们使用MStest而不是NUnit,这样可能不会奏效,但你正在设定(Result)美元,因此应该成为科索沃。 如果在您的建筑服务器上安装了VS2008 SP1,你就可以在您的TfsBuild上添加以下线。 引证(在额外财产部分),不应使建筑失败

<Treat TestFailureAsBuildFailure>true</Treat TestFailureAsBuildFailure>





相关问题
What is the variable signifying the TFS project name?

I am creating a Team Foundation Server (TFS) 2008 build agent for a project of mine. For the working directory, we don t use the default $(Temp)$(BuildDefinitionPath). Instead of Temp, we use a ...

TFS 2008 Build Release Note Like Report

I would like to get some visibility of what changes have gone into our TFS build. Is there some way of finding out all of the resolved work items that have gone into the last X number of builds up to ...

Building select projects only with Team Foundation Build

I’m trying to set up Team Foundation Build and so far it’s running ok with builds, tests and code analysis. My problem is, that I can’t figure out how to build just a subset of the projects included ...

Team Foundation Build (2008) minus the .sln files?

Setting up a new team build in tfs build 2008, you re forced to select a .sln file for your build definition. I ve read through Microsoft.TeamFoundation.Build.Targets, and from what I understand, all ...

Deploy web applications and windows services using TFS 2010

Just went from TFS 2008 to 2010 at a client site and now wondering what happened to the TFSBuild.proj files from the TeamBuildTypes folder. I ve already got the builds and drops working and now I need ...

TFSBuild.Proj and Manual SQL Server Work Help?

Using the VS 2008 GDR update, I have created a database project. I have created a SQL Server deployment package. I have created a database unit test. Using some wizards, the stuff got into my ...

热门标签