One of the activities I get involved in with customers as an ADC is to work with customers in our performance and scalability labs at our UK headquarters in Reading. These labs involve a customer bringing their solution to our facility and building up load on this so that we can analyze, and tune out bottlenecks from the solution. Its a great activity to run with customers and each lab week is unique and fun to work on.
Obviously in such a lab we often are testing web based applications and as such need a tool to generate, co-ordinate and measure load across the whole test environment. In such a scenario this places VSTS Load Testing as the obvious tool for the job.
VSTS Load Testing is a great product and has some fantastic features within it and during the lab weeks it proves time after time to be an essential tool to a successful lab.
One area however the current version of the tool falls short on for our customers is around the portability of their test results which they understandably want to take back to their offices after the hard work during the lab.
The test results in VSTS Load Testing can potentially be quite large and as such unlike WebTest or UnitTest runs the results are not stored in the .trx files generated at the time of the test run. Instead in load testing the results are sent to a database (SQL or SQL Express) configured on the load testing controller machine in Visual Studio (Test Menu->Administer Test Controller) and this database itself is referred to by the .trx file as a encrypted connection string.
Here's where the problem lies obviously with labs like these the chances are that you generate quite a few different sets of test run results and when you come to move these test results from the test rig (in our case in our Microsoft offices) to another database (in our case our customer offices) the connection string is no longer valid.
Thankfully I found an article from a great VSTS blog here: Archi - http://barmagy.com/blogs/archi/archive/2006/12/28/20.aspx that discusses how we can manually edit each of our test run .trx files to change the m_resultsRepositoryConnectString to one for the new database. Essentially this requires you to restore your database and setup VSTS Load Testing (Test Menu->Administer Test Controller) to point to the new restored database. From this point we can get hold of the connection string in the valid encrypted state that connects this load test controller to the database (you can get this if you run a new load test on this machine and find the m_resultsRepositoryConnectString in the .trx file for this new run, or just grab it out the registry at HKCU\Software\Microsoft\VisualStudio\8.0\EnterpriseTools\QualityTools\Controller\LoadTestResultsConnectString)
This is a great solution but as I mentioned in my case my customers often have many test runs from the lab session and so I decided to knock up a small sample to go through a directory (and if required it's subdirectories) to change make this change to all the .trx files. If you want the code you can find it posted here.
Simply run the app after you've restored the database and configured the controller to point at this restored database instance. Select your target directory(s) and let it take the manual steps out the process.
Thankfully this problem will be fixed in the Orcas release of the load testing tools. You can see some further details at Sean Lumleys blog: http://blogs.msdn.com/slumley/pages/managing-load-test-results.aspx