Minimum set of MStest.exe requirements for TFS 2013
We came to a situation where we needed to upgrade our TFS
build agents and controllers from TFS 2012.4 to 2013.3 in order to gain from
bug fixes and features enhancements.
Quick tour of our lab: We have many build and test agents
under one controller. User initiate gated check-in and then TFS start MSBuid
process then MSTest for testing on set of dedicated agents. The agents are
volatile: we remove faulty agents and quickly create new one (or some) using
SC-VMM. Agents are template and the creation done with a few clicks.
The documented way to keep supporting MSTests with TFS
2013.3 is by installing Visual Studio + Update 3 on top of TFS. It comes with a
toll – a lengthy installation time (about one hour for both RTM + Update) and
few gigabytes of disk space. This procedure turn our agents from light, agile
and quickly created, to heavy cumbersome and takes very long to create.
We started looking for alternative, meaning installing the
minimum required for MSTest to run all our functions.
The task was not trivial since in 2012.4 MSTest.exe was part
of the package and using it was seamless. In TFS 2013.3 MSTest is not installed
(it was replaced with . In fact Microsoft pointed to install Visual Studio
Agents on top of TFS 2013.3 Server. That alone was not enough as MSTest fail to
initiate: "Could not load file or assembly
'Microsoft.VisualStudio.TeamSystem.Common.Framework, Version=12.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified."
This assembly obviously is part of the Visual Studio. Again,
we didn't want the full-fledged VS to be installed so we tried using the
lightweight slim version of VS called "Team
Explorer for Microsoft Visual Studio 2013". I managed to trim down the
unnecessary packages and truncate its size to merely 250MB and about 5 min of
setup.
This worked! All but one MSTest function of publishing. On MSTest publishing (the results to TFS DB) we got ".Entry point was not found. Publish failed or canceled.". It appears that this installs the RTM version of VS components and we need to have the Update 3 to fit to all other VS binaries. Once again we needed to install update 3 which requires Internet connection and took a very long time to install.
This worked! All but one MSTest function of publishing. On MSTest publishing (the results to TFS DB) we got ".Entry point was not found. Publish failed or canceled.". It appears that this installs the RTM version of VS components and we need to have the Update 3 to fit to all other VS binaries. Once again we needed to install update 3 which requires Internet connection and took a very long time to install.
Now, this is the cherry pie: I took the Update 3 ISO which
is 4GB and extract it. After searching inside the packages folder I found that
there is one major .msp patch - kb2829760.msp a 120MB package.
This KB is not well documented and if you search for it you
will hit SV 2013 UP3 article.
Anyway, by solely installing it, all VS components get UP3
upgrade and all of our MSTest functions works properly.
All in all we manage to trim down the 4GB VS 2013 and around
an hour to to 100MB of VS Agents + 250MB or Team Explorer + 120MB of kb2829760.msp
which takes about 10min altogether..

