I have been looking at TFS 2010 Lab Manager recently. One problem I had was that using the sample code from the Lab Manager Blog Walkthru the building of the CALC ASP.NET web site failed on the build server, I got an error
ASPNETCOMPILER: error 1003 The directory ‘c:\build\1LabWalkthru\Calculator –Build\Calc’ does not exist.
and the build service was right it didn’t exist; it should have been ‘c:\build\1LabWalkthru\Calculator –Build\Source\Calc’.
This was due to a problem detailed here. The Solution file had the wrong path in the Debug.AspNetCompiler.PhysicalPath property. It was set to “..\Calc” when it should have been “.\Calc”. Once this was altered the build could find the files.
I recently decided to build a demo system for VS2010 Lab Manager. This was for a number of reasons, not least I just wanted to have a proper play with it, but also that I was hoping to do a session on Microsoft Test and Lab Manager at DDD8 (as it turns out my session did not get voted for, maybe better luck for DDS, you can still vote for that conference’s sessions).
Anyway if any of you have looked at the Lab Manager side of MTLM you will know that getting it going is no quick task. Firstly I cannot recommend highly enough the Lab Management Teams’ blog posts ‘Getting started with Lab Management’ Parts 1, 2 ,3 and 4. This type of walkthrough post is a great way to move into a new complex product such as this. It provides the framework to get you going, it doesn’t fix all your problems but gives you a map to follow into the main documentation or other blog posts.
The architecture I was trying to build was as below. My hardware was a Shuttle PC as this was all I could find in the office that could take 8Gb of memory, the bare minimum for this setup. Not as convenient as a laptop for demos, but I was not going to bankrupt myself getting an 8Gb laptop!
As I wanted my system to be mobile, it needed to be it’s own domain (demo.com). This was my main problem during the install. MTLM assumes the host server and all the VMs are in the same domain, but that the domain controller (DC) is on some other device on the domain. I installed the DC on the host server; this meant I had to do the following to get it all to work (I should say I did all of these to get my system running, but they may not all be essential, but they are all sensible practice so probably worth doing)
- Run the VMM Host as a user other than the default of Local System (this is an option set during the installation). The default Local System user has reduced rights on a domain controller, and so is not able to do all that it needs to. I create a new domain account (demo\VMMserver) and used this as the service account for the VMM.
- The ‘Getting Started’ blog posts suggest a basic install of TFS, this just installs source control, work item tracking and build services using a SQL Express instance. This is fine, but this mode defaults to using the Network Service account to run the TFS web services. This has the same potential issues as the Local System account on the DC, so I swapped this to use a domain account (demo\TFSservice) using the TFS Administration console.
- AND THIS IS THE WIERD ONE AND I SUSPECT THE MOST IMPORTANT. As I was using the host system as a DNS and DHCP the VMs needed to be connected to the physical LAN of the host machine to make use of these services. However as I did not want them to pickup my office’s DHCP service I left the physical server’s Ethernet port unplugged. This meant that when I tried to create a new lab environment I got a TF259115 error. Plugging in a standalone Ethernet hub (connected to nothing else) fixed this problem. I am told this is because part of the LAN stack on the physical host is disabled due to the lack of a physical Ethernet link, even though the DNS and DHCP services were unaffected. The other option would have been to run the DNS, DHCP etc on Hyper-V VM(s).
- When configuring the virtual lab in TFS Administration console the ‘Network Location’ was blank. If you ignore this missing Network location or manually enter it you get a TF259210 error when you verify the settings in TFS Administration. This is a known problem in SCVMM and was fixed by overriding the discovered network and entering demo.com.
So I now had a working configuration, but when I try to import my prepared test VM into Lab Center, I got an “Import failed, the specified owner is not a valid Active Directory Domain Services account, Specify a valid Active Directory Domain Services account and try again” error. If I check the SCVMM jobs logs (in SCVMM Admin console) I saw this was an Error 813 in the ‘create hardware setup’ step. However, the account the job was running as was a domain user, as was the service account the host was running on (after I had made the changes detailed above) as I was confused.
This turns out to be a user too stupid error; I was logged in as the TFS servers local administrator (tfs2010\administrator) not the domain one (demo\administrator), or actually any domain account with VMM administrator rights. Once I logged in on the TFS server (where I was running MTLM) as a domain account all was OK. Actually I suspect moving to the VMMService and TFSService accounts was not vital, but did not harm.
I could now create my virtual test environment and actually start to create Team Builds that make use of my test lab environment. Also I think having worked though these problems I have a better understanding of how all the various parts underpinning MTLM hang together, a vital piece of knowledge if you intend to make real use of these tools.
Oh and thanks to everyone who helped me when I got stuck
Today Typemock released their Isolator 6.0 version with full support for VS2010. Check out the full announcement at their site, there some nice new features there.
I have at last got round to setting up a full installation VS 2010 Test and Lab Manager using the excellent notes from the Lab Management Team. Whist installing the build server portion I got a strange set of errors.
TF255425: An error occurred while installing the following Windows service: TFSBuildServiceHost.exe. For more information, open Event Viewer and review the application log.
TF255070: Configuring services for Team Foundation Build failed with the following exception: TF255425: An error occurred while installing the following Windows service: TFSBuildServiceHost.exe. For more information, open Event Viewer and review the application log..
Further investigation found the installer was claiming it could not find required files and so could not complete the install.
After a good deal of ineffective fiddling I cam to the conclusion the issue must be user access. I was using the trial Windows Server 2008 R2 vhds as the basis of my TFS server and test VMs, now these default to US region and keyboard. This had gotten on my nerves and I thought I had changed it to UK settings. However, I must have done it wrong as I had a UK keyboard in WinForm application but not in a Command Prompt. Once I made sure that my region, keyboard (and associated defaults) were all set to UK (and were working as expected in all locations) I tried the wizard again and it worked.
So it seems the issue was an incorrect password being passed to the installer. Some how the @ in Pass@word1 was being translated behind the scenes I guess to “ and causing the wizard to fail, though it always passed the verify stage of the wizard.
So the technical tip is to make sure the keyboard and region are right before you start, bit of a newbie error there!
I am off to present in Ireland this week in a double header with another of Black Marble's test team, Robert Hancock. We will be appearing at the Microsoft Ireland Visual Studio Academy. Our subject is Improved efficiency throughout the test cycle. As registration is still open I guess there are still spaces, so if it is of interest to you why not sign up (and who is not interested in testing?)
So while many of our staff are off living it up in Las Vegas for the SharePoint conference, Robert and myself have been busy building a demo rich session for the Dublin event that touchs on a whole host of different testing tools and techniques. So we hope to see you there for what should be a very interesting session.
I have just attended an excellent free webinar session on ASP.NET testing with Ivonna and Typemock by Gil Zilberfeld of Typemock and Artem Smirnov creator of Ivonna a Typemock add-on for unit testing ASP.NET
The session is being repeated today at 2pm GMT and I understand a recording will appear on the Typemock site in due course.
So if you get a chance this afternoon have look, it is well worth your time if you work in the ASP.NET space. Personally I have also found Ivonna useful for Sharepoint testing too, watch the session it might give you some ideas.
Thanks to everyone who turned up for my presentation on Typemock and Sharepoint in Glasgow last night. I have just upload my slides onto the Black Marble site. As the session was quite demo driven the slides don’t offer the best code samples. If you want to experiment yourselves I would suggest you look at my related posts on this blog and remember if you don’t have Typemock you can download trial versions of all the products I used from www.typemock.com
On Wednesday the 15th this week I will be speaking at Scottish Developers on developer testing of SharePoint. This is a free event so please come along if you are interested and in the area.
If you are not able to make it to Glasgow but are interested in the subject then why not check out Typemock’s free live webinars also on the 15th.
VS2010 has excellent new features to assist the tester in general, and specifically in the area of manual testing. One of these is the ability to video a manual test run; to get this to work you have to have the Windows Media Encoder 9 installed as well as the VS2010 Test Runner . If you don’t have it installed and try to use the video feature you get a dialog that warns you this component is missing and would you like to either download it or disable video recording feature for this test run.
The problem is the warning dialog has a link that takes to you the Windows Media Encoder 9 homepage. This gives you the option to install either the 32bit or 64bit version. I mistakenly assumed that I needed the version for operating system I have i.e. 64bit as I run 64bit Windows 7. THIS IS WRONG.
VS2010 Test Runner only seems to work if you have to install the 32bit and the hotfix the Test Runner dialog mentions. Once I installed the 32bit video recording of the test worked perfectly.
Ben Hall has written an interesting post on creating a testing framework with MEF. As Ben said it is more a learning exercise for MEF than a useful product but it certainly show show the ease you can add meta data and reflection like functionality to your codebase. Wish it had been about when I wrote GUITester