TeamBuild throws errors when deploying "additional files and directories" for unit tests

I am using RC.

I have configured TeamBuild to run unit tests defined in a test run configuration. All the build steps work correctly except when TeamBuild tries to copy the "additional files and directories" specified in the test run configuration it runs into a UnauthorizedAccessException.

When I run the unit tests locally all the additional files and directories are correctly copied to the /TestResults/<test run name>/Out directory.

When I try to execute the build on the build server, the log file shows that TeamBuild is trying to copy the files on top of themselves. Isn't TeamBuild supposed to copy all the required files to a dedicated test run directory in the same way that a dedicated run directory is used when you run your unit tests locally (see above)

Excerpt from TeamBuild log file (I have substituted the project name, build type and file name):

C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild\Microsoft.TeamFoundation.Build.targets : warning : Warning: Test Run deployment issue: Failed to copy file 'c:\builds\<project name>\<build type>\sources\main\foo.xml' to 'c:\builds\<project name>\<build type>\sources\main\foo.xml': System.UnauthorizedAccessException: Access to the path 'c:\builds\<project name>\<build type>\sources\main\foo.xml' is denied.



Answer this question

TeamBuild throws errors when deploying "additional files and directories" for unit tests

  • sumesh_tewatia

    By the way, it appears that where I have explicitly specified files to be copied an error is NOT thrown.  There is only an error on the copy folder operation. Here is an excerpt from the .testrunconfig file:

      <deploymentItems type="Microsoft.VisualStudio.TestTools.Common.DeploymentItemCollection">
       <m_container type="System.Collections.Hashtable">
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">Company.ProjectConnect.Connector.Test\TestFiles\</path>
         <outputDirectory type="System.String"/>
        </key>
        <value/>
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">hosttest.app.config</path>
         <outputDirectory type="System.String"/>
        </key>
        <value/>
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">hosttestSettings.xml</path>
         <outputDirectory type="System.String"/>
        </key>
        <value/>
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">ProjectConnect.EntLib.config</path>
         <outputDirectory type="System.String"/>
        </key>
        <value/>
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">Company.Project.Test\Test Files\</path>
         <outputDirectory type="System.String"/>
        </key>
        <value/>
       </m_container>
      </deploymentItems>

     


  • Thomas LEBRUN

    My apologies, this some how missed my radar. We will look into this and come back to you asap.

  • Ivan Ooi

    Can you post the deployment items that are included in the test run configuration file Open the runconfig file from solution explorer in VS and post the list of files and folders included in deployment section with the complete path as in there.

  • BurnChrome

    Andrew, thanks for reporting this. This happened to be a known issue with a simple workaround. Can you remove the trailing slashes from the deployed folder names in runcofig file and try

    Looking at the excerpt that you sent, you will need to replace 'Company.ProjectConnect.Connector.Test\TestFiles\' with 'Company.ProjectConnect.Connector.Test\TestFiles' and 'Company.Project.Test\Test Files\' with 'Company.Project.Test\Test Files'.

    Please let us know if this does not solve your problem.

    Thanks.



  • Levyuk

    That did the trick.

    Thanks.


  • andyboy

    Is anyone from Microsoft going to respond to this Again, this is an out of the box installation of RC. Out of the box configuration of a build and unit testing with deployed files. The build does NOT work on Team Build. I am forced to turn off unit testing to get my builds to run on Team Build so I get no unit test results or code coverage on my build reports. Will this be addressed before RTM
  • TeamBuild throws errors when deploying "additional files and directories" for unit tests