Saturday, July 19, 2014

TFS2013 Build, New Features Overview 1

TFS2013, brought many ALM ,cource control and  web access changes.
one of these changes was the integration of Git as a source control from Team projects.
another small one was adding scripts to the build templates.

TFS2013 brings us 2 new Build Templates
  1. TFVCTemplate.12.Xaml
  2. GitVCTemplate.12.Xaml
i will talk most on the TfvcTemplate.
here the template ,as you can see it's very simple compared to the previous versions (tfs2010 /2012).


here is the exception handling 
 here is the finally clause of the Try. the most important activity here is the "Reset the Environment".
this activity clears all the TF build environment variable which will talk about later.
 the template contains no If statements or parallel. so how does it control the activities?
simple each activity has an Enable switch.
also you might notice that there is no "for-each" like for the MSBuild like previous versions.
this means that a lot of the logic was entered to the MSBuild Activity.
you might also notice that there is no Get Build or Create workspace.
this was done to expose some common variables to the power shell scripts

CodedUI - Running tests on remote machines

CodedUI is just one of many UI testing tools.
It's a great tool for testing UI although it has it's problems.
but this post does not talk about the problems or it's wonderful abilities.

I want to show you how you can run the codedui Test from a build machine or directly from VS2010/2012 on VMs.

first of all we need to install a Test Rig, meaning install Test Controller and Test agents
you can use the following link to do that: http://msdn.microsoft.com/en-us/library/vstudio/hh546459.aspx

P.S: since we are not using the Lab Management don't associate the controller with a collection. also make sure the test agent runs in interactive mode.

we then need to set up the test settings file to execute the test remotely and give it the test controller name.

set the test setting file as active


now we are ready to run the codedui tests and they will run on the VM.
but it fails, it says something about remote connection not active?
well yes one of the draw backs of running on VMs you need an active RDP connection and minimized is no good, it must be up.

luckily there is a workaround, every OS running as VM has a console session that is always open against the host. we use the following command to use it:
tscon RDP-Tcp#0 /Dest:Console

more information about TsCon: http://technet.microsoft.com/en-us/library/cc770988.aspx

just 2 things:
1. you are local admin on the machine (you need permissions on Console session)
2. after you run this command you are automatically disconnected!!!

because of option 2 i always add the video data collector
[image]
so i can see the test result. the CodedUI log is hard to decipher.

you will notice that the test if it failed was usually due to the low resolution of the console.
for this problem i created a special data collector that has the ability to change the resolution of the machine,
I created a "Change Resolution Data Collector".

https://onedrive.live.com/redir?resid=C4BEA458C5283F0B!270&authkey=!APVYd1IOyjoryDk&ithint=file%2c.msi