4

Using the Microsoft Fakes Framework, I am trying to run my Unit Tests on our TFS build server. Local it works fine, but it doesn't work on the build server:

Screenshot TFS build server report failed unit tests

It seems that not the correct files have been copied to the output directory. What files should I copy (besides the unit tests and the tested project classes)? Should I copy the Fakes dll's for example?

dpwulp94
  • 163
  • 1
  • 8
  • Obviously your tests won't run without the Fakes substitution dlls. They have the types you use to fake/stubs/shims. So yes I guess you need to copy them as well. – Spock Oct 07 '13 at 10:38
  • I have checked the files being copied: UnitTests/Fakes/Bll.Fakes, UnitTests/Fakes/DataAccess.fakes. Even the UnitTests/bin/Debug/* is copied (not required i think). What else should i copy? What files are missing? – dpwulp94 Oct 07 '13 at 11:25
  • What exception you exactly see in the build log? Something like ... Microsoft.QualityTools.Testing.Fakes.Shims.ShimNotSupportedException: System.IO.File ? – Spock Oct 07 '13 at 11:58

1 Answers1

4

You need to have Visual Studio Premium / Ultimate installed on the build server.

Once you have it installed you should be able to execute the builds. I am fairly sure that it will copy the correct files during the build just like it does locally.

  • 1
    Currently we aren't using Visual Studio Ultimate on the build server. We have just copied the **msbuild folder** of .Net 4.0 to the build server. Is there any way to run Fakes on the build server, without installing Visual Studio Ultimate? For example, are there files that should be copied? – dpwulp94 Oct 07 '13 at 13:51
  • 1
    You will be required to install Visual Studio to get the functionality you want. There is no licence required. If you have one ultimate licence in your organisation you can use Ultimate. – MrHinsh - Martin Hinshelwood Oct 07 '13 at 17:20
  • Also I thought if you have vs2012 update 2 installed and with the premium version you can run fakes. http://blogs.msdn.com/b/bharry/archive/2013/01/30/announcing-visual-studio-2012-update-2-vs2012-2.aspx – Spock Oct 07 '13 at 21:06
  • Thanks @Raj I forgot about that... never the less.. one need at least a version of VS :) – MrHinsh - Martin Hinshelwood Oct 08 '13 at 01:24
  • Thanks, I am going to install VS Ultimate on our build-server. We do have an VS Ultimate license in my organisation. – dpwulp94 Oct 08 '13 at 06:59
  • 1
    Could you elaborate why it is imperative to have VS installed on the build server? I would like to avoid that if at all possible. I wonder if there is just a set of files that need to be copied for it to work, like with some .targets files for web projects and such. – julealgon Feb 05 '14 at 21:31
  • Could you elaborate on why you do not want to? There is no licence cost and A build server is not a mirror of production but of your development environment. Anyhow, most of the tools within visual studio are bound to the ide so while you can do a simple compile without it you will likely be using at least some of the additional tools. – MrHinsh - Martin Hinshelwood Feb 06 '14 at 16:17
  • 1
    You should really use the @ tag, as I've not been notified of your response. I came back to this question to link it to a work item related to installing VS on our build machine. We would like to avoid VS in the build machine because it is extra overhead and we are very hardware limited. The hard drive space required alone is a waste, as we have managed to make everything work thus far without needing VS directly. I thought this would be a similar situation in that just copying a few files would produce correct behavior. – julealgon Feb 17 '14 at 20:21