views:

39

answers:

2

Hi,

I'm using Visual Studio Team Build. My build compiles stuff and then runs some automated tests. If the tests fail, the build ends with status "Partially succeeded". When this happens, the only file in the drop directory is the build log. It seems that team build only copies the contents of the Binaries folder to the drop directory if the build ends with "Succeeded".

But, I really need to see the files from the Binaries directory to help me diagnose why the build only partially succeeded.

Is there a way to force team build to write to the drop directory when the build is only "Partially Succeeded"?

Thanks.

A: 

This is strange. The default behaviour is that the build output is copied to the drop location in case when the tests fail. Can you see in the build log why it partially succeeds?

Ewald Hofman
It partially succeeds because the Test target raises an error, but the Compile target succeeds... I hope that makes sense.
Scott Langham
A: 

I've forced it by adding the following to my TFSBuild.proj. It doesn't feel very neat though.

<PropertyGroup>
    <CoreTestDependsOn>$(CoreTestDependsOn);SmokeTest</CoreTestDependsOn>
</PropertyGroup>

<Target Name="SmokeTest">

    <!-- Exec stuff here to run some tests, output exit code to property SmokeTestExitCode. Use ContinueOnError="true" -->

    <!-- Still create drop folder even if build ending with status "Partially Succeeded" -->
    <CallTarget Condition="'$(IsDesktopBuild)'=='false' And '$(SmokeTestExitCode)'!='0'" Targets="DropBuild"/>

    <!-- Now, after creating drop folder, raise error to cause "Partially Succeeded" instead of "Succeeded" -->
    <Error Condition="'$(SmokeTestExitCode)'!='0'" Text="Smoke Test Failed with exit code=$(SmokeTestExitCode)"/>
</Target>
Scott Langham