Chris's profileChris Burrows' Live Spac...PhotosBlogListsMore Tools Help

Blog


    September 07

    Unit Tests failing because files cannot be found on build machine

    After my post yesterday on Using External Files in unit tests, I found a bug when using the deployment section of a testrunconfig file to copy a directory of files.  Whilst this worked fine on the local developers machine, however when it ran on the build server the files didn't appear.   After about 30 minutes of googling I came across this post in the forums.   I've taken the steps and modified them slightly so you don't have to leave Visual Studio.

    1. In Visual Studio right click on your active .testrunconfig file in the solution items directory.  This is usually called localtestrun.testrunconfig.

    2. Selected open with and choose the XML editor

    3. Find your folder in the file.   Unfortunately, the XML is produced in on big line that means that using the find command is the quickest way of doing this. 

      <deploymentItems type="Microsoft.VisualStudio.TestTools.Common.DeploymentItemCollection">
       <m_container type="System.Collections.Hashtable">
        <key type="Microsoft.VisualStudio.TestTools.Common.DeploymentItem">
         <path type="System.String">MyProject\DBScriptFolder\</path>
         <outputDirectory type="System.String" />
        </key>
        <value />
       </m_container>
      </deploymentItems>

    4. Delete the '\' (backslash) from the end of that string

    5. Save and check-in.  Sit back and watch the continuous integration fly!!

    Comments (1)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Darrenwrote:
    Nice to see your blog is gleaming now mate ;-)
    Sept. 7

    Trackbacks

    The trackback URL for this entry is:
    http://madtechnology.spaces.live.com/blog/cns!F637E4FD356E127D!118.trak
    Weblogs that reference this entry
    • None