Solved

Team Build fails while copying test results to drop directory

Posted on 2009-05-14
3
1,239 Views
Last Modified: 2013-12-17
We're developing an automated Team Build in Visual Studio 2008.  All the code compiles and all the tests run successfully - but the overall build fails at the very end with this error message:

"The drop share directory <whatever> could not be accessed"

This is basically because MSBuild wants to copy the test results to the drop share directory, which it's just created, but doesn't seem to have permissions to!  Since we're not willing to put the drop folder on the TFS server machine (which seems to be the general advice for this problem), we need to disable this final step, the publishing of test results to the drop folder.  We had a workaround in place in our TFSBuild.proj file when we ran it in Visual Studio 2005, but apparently MSBUILD has changed significantly in VS2008, and this workaround no longer works.  The question is: what entries do I need to add to TFSBuild.proj to bypass the step of copying test results to the drop folder so that the build succeeds?
0
Comment
Question by:BSWatts
  • 2
3 Comments
 
LVL 23

Assisted Solution

by:Admin3k
Admin3k earned 500 total points
ID: 24393699
- are we talking about TFS2005 or 2008, which version of the server product exactly ? 
-Is the account that starts the build the TFS builtin service account ?, this should also be a domain account.
- Make sure this TFS services account is an admin on the server where the binaries are dropped, or at least  has Read/Write access (both share & security) on the root directory of the drop  location.
if I have misunderstood you, can you please post the log with the exact errors .


0
 

Author Comment

by:BSWatts
ID: 24397522
Thanks for your response.

This is TFS2008.  The account running the build service is a domain account with permissions to the necessary folders, and also a local admin on the build machine.

This question is not about permissions.  We've already spent quite a bit of time trying to solve this problem via permissions.  For a sample of the existing discussions, you can look here:

http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/0e9e30f9-68b0-4bb0-b21b-56c8eb1a562f

Since we don't care about publishing the build results, we have decided to skip that step in our build.  This question asks how to modify TFSBuild.proj to accomplish that.

I had already found a workaround for this issue in Visual Studio/TFS 2005.  It basically adds XML to TFSBuild.proj to override one of the targets in Microsoft.TeamFoundation.Build.targets in such a way that the test results publication is skipped.  Here is that code:

<Target Name="RunTestWithConfiguration" >
    <TeamBuildMessage
          Tag="Configuration"
          Condition=" '$(IsDesktopBuild)'!='true' "
          Value="$(Flavor)" />

    <TeamBuildMessage
          Tag="Platform"
          Condition=" '$(IsDesktopBuild)'!='true' "
          Value="$(Platform)" />

    <!-- SearchPathRoot for not Any CPU -->
    <CreateProperty
          Condition=" '$(Platform)'!='Any CPU' "
          Value="$(BinariesRoot)\$(Platform)\$(Flavor)\" >
      <Output TaskParameter="Value" PropertyName="SearchPathRoot" />
    </CreateProperty>

    <!-- SearchPathRoot for Any CPU -->
    <CreateProperty
          Condition=" '$(Platform)'=='Any CPU' "
          Value="$(BinariesRoot)\$(Flavor)\" >
      <Output TaskParameter="Value" PropertyName="SearchPathRoot" />
    </CreateProperty>

    <!-- Test task that doesn't publish results -->
    <TestToolsTask
          Condition=" '%(MetaDataFile.Identity)'!='' "
          SearchPathRoot="$(SearchPathRoot)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(MetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(MetaDataFile.TestList)"
          ContinueOnError="true" />
  </Target>

However, this doesn't work in Visual Studio 2008 - for one thing, there's no longer a target called RunTestWIthConfiguration.  As near as I can tell, the appropriate target is now called CoreTestConfiguration - but I haven't been able to modify it to get everything to work.  I need for someone to give me a chunk of XML that I can plug into TFSBuild.proj which will cause the test results publication to be skipped.

Thanks!
0
 

Accepted Solution

by:
BSWatts earned 0 total points
ID: 24413905
Hey, I figured it out!

So, basically what you do is, you copy the XML section for the target in question ("CoreTestConfiguration") from Microsoft.TeamFoundation.Build.targets (which is in the MSBuild directory) and paste it into TFSBuild.proj - this way, the TFSBuild.proj version overrides the Microsoft.TeamFoundation.Build.targets one.  Then you change the section relating to the build scenario in question - in this case, "<!-- MetaDataFile tests for non-desktop builds. -->"  For this section, you remove the items that relate to copying the test results (this is the tricky part: knowing which items these are).  The ones I removed are: BuildFlavor, Platform, PublishServer, PublishBuild, and TeamProject.  The resulting XML is shown below:

<Target Name="CoreTestConfiguration"
          DependsOnTargets="$(CoreTestConfigurationDependsOn)"
          Outputs="@(TestOutputs)">

    <Warning Condition=" '$(V8TestToolsTask)'=='true' and '$(TestNames)'!='' "
             Text="Warning: The TestNames property cannot be used in in combination with the V8 TestToolsTask and will be ignored." />
    <Warning Condition=" '$(V8TestToolsTask)'=='true' and '@(LocalTestContainer)' != '' "
             Text="Warning: The TestContainer item group cannot be used in combination with the V8 TestToolsTask and will be ignored." />

    <PropertyGroup>
      <ContinueOnTestError Condition=" '$(StopOnTestFailure)' != 'true' ">true</ContinueOnTestError>
      <ContinueOnTestError Condition=" '$(StopOnTestFailure)' == 'true' ">false</ContinueOnTestError>
    </PropertyGroup>

    <!-- MetaDataFile tests for non-desktop builds. -->
    <TestToolsTask
          Condition=" '$(IsDesktopBuild)'!='true' and '$(V8TestToolsTask)'!='true' and '%(LocalMetaDataFile.Identity)' != '' "
          SearchPathRoot="$(OutDir)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(LocalMetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(LocalMetaDataFile.TestList)"
          TestNames="$(TestNames)"
          ContinueOnError="$(ContinueOnTestError)" />

    <!-- 8.0 MetaDataFile tests for non-desktop builds. -->
    <TestToolsTask
          Condition=" '$(IsDesktopBuild)'!='true' and '$(V8TestToolsTask)'=='true' and '%(LocalMetaDataFile.Identity)' != '' "
          BuildFlavor="$(Configuration)"
          Platform="$(Platform)"
          PublishServer="$(TeamFoundationServerUrl)"
          PublishBuild="$(BuildNumber)"
          SearchPathRoot="$(OutDir)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(LocalMetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(LocalMetaDataFile.TestList)"
          TeamProject="$(TeamProject)"
          ContinueOnError="$(ContinueOnTestError)" />

    <!-- TestContainer tests for non-desktop builds. -->
    <TestToolsTask
            Condition=" '$(IsDesktopBuild)'!='true' and '$(V8TestToolsTask)'!='true' and '@(LocalTestContainer)' != '' "
            BuildFlavor="$(Configuration)"
            Platform="$(Platform)"
            PublishServer="$(TeamFoundationServerUrl)"
            PublishBuild="$(BuildUri)"
            SearchPathRoot="$(OutDir)"
            PathToResultsFilesRoot="$(TestResultsRoot)"
            RunConfigFile="$(RunConfigFile)"
            TestContainers="@(LocalTestContainer)"
            TeamProject="$(TeamProject)"
            TestNames="$(TestNames)"
            ContinueOnError="$(ContinueOnTestError)" />

    <!-- MetaDataFile tests for desktop builds. -->
    <TestToolsTask
          Condition=" '$(IsDesktopBuild)'=='true' and '$(V8TestToolsTask)'!='true' and '%(MetaDataFile.Identity)' != '' "
          SearchPathRoot="$(OutDir)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(MetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(MetaDataFile.TestList)"
          TestNames="$(TestNames)"
          ContinueOnError="$(ContinueOnTestError)" />

    <!-- 8.0 MetaDataFile tests for desktop builds. -->
    <TestToolsTask
          Condition=" '$(IsDesktopBuild)'=='true' and '$(V8TestToolsTask)'=='true' and '%(MetaDataFile.Identity)' != '' "
          SearchPathRoot="$(OutDir)"
          PathToResultsFilesRoot="$(TestResultsRoot)"
          MetaDataFile="%(MetaDataFile.Identity)"
          RunConfigFile="$(RunConfigFile)"
          TestLists="%(MetaDataFile.TestList)"
          ContinueOnError="$(ContinueOnTestError)" />

    <!-- TestContainer tests for desktop builds. -->
    <TestToolsTask
            Condition=" '$(IsDesktopBuild)'=='true' and '$(V8TestToolsTask)'!='true' and '@(LocalTestContainer)' != '' "
            SearchPathRoot="$(OutDir)"
            PathToResultsFilesRoot="$(TestResultsRoot)"
            RunConfigFile="$(RunConfigFile)"
            TestContainers="@(LocalTestContainer)"
            TestNames="$(TestNames)"
            ContinueOnError="$(ContinueOnTestError)" />

    <!-- Populate TestOutputs with MetaData Files and Test Containers. -->
    <ItemGroup>
      <!-- TestContainer tests for non-desktop and desktop builds. -->
      <TestOutputs Condition=" '@(LocalTestContainer)' != '' "
                   Include="%(LocalTestContainer.Identity)">
        <Platform>$(Platform)</Platform>
        <Configuration>$(Configuration)</Configuration>
      </TestOutputs>
      <!-- MetaDataFile tests for non-desktop builds. -->
      <TestOutputs Condition=" '$(IsDesktopBuild)'!='true' and '%(LocalMetaDataFile.Identity)' != '' "
                   Include="%(LocalMetaDataFile.Identity)">
        <Platform>$(Platform)</Platform>
        <Configuration>$(Configuration)</Configuration>
      </TestOutputs>
      <!-- MetaDataFile tests for desktop builds. -->
      <TestOutputs Condition=" '$(IsDesktopBuild)'=='true' and '%(MetaDataFile.Identity)' != '' "
                   Include="%(MetaDataFile.Identity)">
        <Platform>$(Platform)</Platform>
        <Configuration>$(Configuration)</Configuration>
      </TestOutputs>
    </ItemGroup>
  </Target>

This resulted in the results not being copied, and a successful build!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Loop not working 29 47
Format column on datatable 7 28
ASP.NET Web API or ASP.NET Core MVC? 3 52
I need help exporting info from a dataset to Excel in my VB.Net application 7 50
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now