Limiting the number of test run results in Visual Studio 2005

I have a “set” of VS2005 unit tests that attach db as part of initialization. Tests change db quite often, so before each test run you need to return it to a known state.

I deploy the test db to the out folder of each TestResult and attach it in the MyClassInitialize method.

The database is quite large, so it takes up a lot of space, as more and more created test results.

Is there any way from Visual Studio to limit the maximum number of saved test results? i.e. stores a maximum of 5 + deletes the oldest when striking 5?

Hello,

Matt

+4
source share
3 answers

This works from VS2010 (from MSDN):

To limit the number of saved test runs 1. In Visual Studio, click "Options" in the "Tools" menu.

The Options dialog box appears.

2. Open the test tools and click Test.

3.Support test results. Select the number of test runs you want to save.

4. Click OK.

+5
source

You can create a method that runs when you initialize a test that is viewed in the right place and simply uses file processing to delete a specific number, however the method you suggest can cause problems if several users try to run unit tests at the same time (in depending on the setting of the test environment).

The method that I usually use is to create a copy of the database in the initialization of the test, then during testing, to remove the used copy, we usually add a pointer to the database name to ensure uniqueness. The biggest problem with this method is that if you cancel the tests during debugging, the database will never be deleted.

0
source

As far as I can see, you cannot limit the number of test run results stored in Visual Studio.

0
source

All Articles