Moving VSTS 2005 Load Test results from one computer to another
In VSTS 2008, it is now possible to easily export load test results from one test environment and import them into a load test results database on another machine using the Load Test Run as described in this blog post by Sean Lumley: http://blogs.msdn.com/slumley/pages/managing-load-test-results.aspx . For those still using VSTS 2005, this process is considerably more difficult, but can be done by following the steps outlined below.
Every time you record a test, there is a trx file (xml format) created with the test configuration (in the TestResults subdirectory of your Visual Studio solution), and the actual datapoints from the counters in the tests go into the database. The challenge is that VSTS needs both the data out of both the trx files, and out of the database to display the results. This is much complicated by the fact that each trx file stores an encrypted (well, sort of, it is just base64 I think) database connection string inside.
On the Original System
1. Backup the SQL database (normally called LoadTest).
2. Backup the Visual Studio test solution directory (and subdirectories), making sure that the TestResults subdirectory (with all the trx files) is there.
On the New System
1. Restore the SQL database to where you want it, you can rename it if you want.
2. Restore the solution directory to where you want it.
a. You will probably have to change where the datafiles will go.
3. Open the restored Visual Studio Test Solution
4. Got to the dialog box “Test/Administer Test Controller” and adjust the connection string to point to the new database (using its new name).
a. Make sure the “Test Connection” works once you have done this.
5. Now we need to find out what the new encrypted connection string needs to be.
a. Create a new empty web test
b. Create a new load test, that just uses the above web test, and runs with only 1 user and just 1 minute (or less)
c. Run that test.
d. Now go open that new trx file (it should be in there in the results directory with all the other runs you made before on the original computer).
e. Look for the m_resultsRepositoryConnectString tag. The base64 string entered there is what we need, that is to be the new connection string.
6. Now open all the other trx files and substitute the new string with the old string
a. Yes, this is a lot of work.
b. There is one file per test.
c. The trx files all have no carriage returns, the only editor I have done this successfully with is notepad, but others may work.
d. If somebody knows of a utility that can do this in one go (most choke on the super-long lines), please let me know.
7. Now you should be able to open any of the old tests.
Example data in m_resultsRepositoryConnectString
Old String: LAs4ogoKlDcZrBwv3CM84HZA8b3iJ4JSR2lKoHXgJ7oz1KcIrnweuizsla/9JfUpzAu5B0U4WLxUVzF+Z8MdWkjZNQHLC3688S+MpAQ2Vvo=
New String : LAs4ogoKlDfsEt3rCAkhug1CF4HW0Js4sLBA4bVCYx5VrfuUB5nvZLRPgdrpXc8MEqSwtkzTw6hi7eQxv8esjdY+x94EtJ81KBCls79Hazk=