?
Solved

Team Build fails while copying test results to drop directory

Posted on 2009-05-14
3
Medium Priority
?
1,282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Assisted Solution

by:Mohamed Osama
Mohamed Osama earned 2000 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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

764 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