views:

37

answers:

1

A lot of people new to CI (Continuous Integration) install VS (Visual Studio) on their CI server "because it is required to compile the code". MSTest is a common reference brought up here.

Why should I not install VS (or generally speaking, any software not out-of-the-box) on my CI server?

(This question has not been asked before apparently, so I'm adding it for reference. If it already exists, sorry, I missed it, please merge. If no answer is provided to this question within some time I can add one myself)

+4  A: 

Because you don't need to. A Visual Studio license is pretty expensive, so having one just lying around on a server where no one's using it is just a waste.There are a couple of arguments why you would still need to install a full blown Visual Studio instance on your Continuous Integration server - but here are their counter arguments:

Reason 1: I need it to compile.
Reality: No, you don't. You need MSBuild to compile, but that is available for free, in the Windows SDK. Note that there are several versions for different operative systems and .NET versions, so be careful to download the correct one.

Reason 2: I need it to make quick fixes on the server.
Reality: No, you don't. You shouldn't make quick fixes on the server - you should check out from your version control system, make the fix, build and run tests locally until it works, check in, and have the CI system do the rest for you. That's why you have a CI system.

Reason 3: Without Visual Studio, I can't run MSTest no my CI server.
Reality: Wrong. AFAIK, the MSTest runner is also part of the SDK (at least that's what it seems like on our CI server here - although I can't verify it since we don't have any tests at the moment...). However, a quick googling found this blog post which explains how to do it without the SDK as well. I haven't read through it in detail, so I can't promise that it works, or that it's legal. You have been warned.

Feel free to add more reasons in comments, and I'll counter them.

Tomas Lycken
could you add MSTest?
mafutrct
@mafutrct: See my update.
Tomas Lycken
Nice :) I'm still missing that changing the environment to something non-standard (installing VS changes some environment variables, adds DLLs, ...) leads to a different environment from the end-user, possibly causing problems (for instance, DLL on CI server but not on user's box). This needs to be elaborated a bit of course, I'm not an expert on this topic at all.
mafutrct
@mafutrct: Are you suggesting the fact that VS isn't installed, and thus that the environment variables aren't set and all dlls aren't present, is a good thing or a bad thing? I definitely think it's a good thing - that means your CI system will find bugs that arise because of this before your users do.
Tomas Lycken
yes, that's what i mean.
mafutrct