Solved

Team Build fails while copying test results to drop directory

Posted on 2009-05-14
3
1,246 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 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