TFS 2010 - Test Impact Analysis Series - Part 3

12/30/2010
This post is part of a short series about Test Impact Analysis. You can find part 1 here and part 2 here.

So in this post we are going to focus on the client portion of our environment. How it works and what can possibly go wrong.

As we learnt in part II we need to turn on the ASP.NET Client Proxy for IntelliTrace and Test Impact in order to get Test Impact data collected. Why is this? What does it do? What can go wrong?

After some investigation I have found the following. This setting actually changes your IE (or other browsers) proxy settings in order to intercept and monitor the calls. If you start a test (with Impact Analysis enabled) and then start and new instance (not tab) of IE, go check out the proxy settings and you will see the following:-




As you can see we have a custom proxy setup with a loopback address. When the test is finished and a new browser launched these settings will be gone. This is how the Client Proxy works.


What can go wrong?

One error that I have seen is when an existing proxy is setup with an automatic configuration script (.pac file) This is commonly used in corporate environments. If you have this setup then you're proxy settings will look something like:-

If you have this type of setup then the Test Impact analysis will fail. It seems like this setting has a greater precedence than the custom proxy setup that MTM uses. When you run a test you will see an attachment on your test results called TestRunCollectorWarning.xml - this file contains the reason that TIA could not be collected. If we open it we see an error message saying
IntelliTrace is configured to collect data from IIS, but
no Web request was intercepted during the test. Verify that the "ASP.NET
Client Proxy for IntelliTrace and Test Impact" is selected in the diagnostics
and data page of your test settings, and that "localhost" or "127.0.0.1" is not
being used to contact the server. You can safely ignore this warning if
you are not testing a web application or web service on the IIS server.


Now we cannot safely ignore this because we are testing a web application. So the secret is to uncheck the pac script setting in IE before launching a new IE window to run the test. e.g.

  1. open a new instance of IE
  2. uncheck the pac script option
  3. close the instance
  4. run test
  5. open new ie instance to run application under test, this will now have the correct proxy settings.

Happy testing! This leads us on to part 4 - What happens on the web server!

12/30/2010

No comments :

Post a Comment