In this post, we'll take a step forward and add a custom task to CCNet that will query the database and generate a custom xml summary that includes performance comparison with previous runs, performance counters measurements per machine (divided to logical groups) and exception details for all the tests that have failed. We will also extend the CCNET portal to present the custom content.

Getting Started!

Let's review the process that generates the summary xml out of the LoadTest2010 database (where the load test data is saved).

Here's the class diagram

We used 'LINQ to SQL' is to query data from the LoadTest2010 database.

Using 'Server Explorer' we can connect to the LoadTest2010 database and drag/drop the appropriate Tables/Views onto the dbml editor surface. For each Table/View – matching metadata classes and CRUD operations are automatically generated.

The auto-generated classes (LoadTest2010DataContext, LoadTestTestResult, LoadTestMessageSummary, LoadTestRun, LoadTestTransactionResult, ) are used by DataAccessService for all the interactions with the database.

The difference between this configuration and the configuration in the previous post, is that here we have an extra task for running the process LoadTestDbToXml.exe (explained above). This process queries the LoadTest2010 database and creates xml name LoadTestSummary.xml. In addition, instead of adding the test result trx to the build log, we will add LoadTestSummary.xml.

With the configuration above, CCNet will do the following (every 4 hours or one demand):

Delete the last LoadTestSummary.xml

Build the BookStore.sln

Run the load test.

Run LoadTestDbToXml.exe (this run will generate LoadTestSummary.xml)

Add LoadTestSummary.xml to the build log (so we can present it in the portal)

Now. we need to extend the CCNet portal to present the results. We need to:

Create xsl that transform the LoadTestSummary.xml to HTML

Copy the xsl to '%Program Files%\CruiseControl.NET\webdashboard\xsl'

Add link to the xsl to 'Program Files (x86)\CruiseControl.NET\webdashboard\dashboard.config'