Thea Burger's Blog

Wouldn't you like to know...

News

Photo's!!!

About me

I'm Reading: General Blogs

I'm Reading: Technical Blogs

July 2006 - Posts

Energy burned/day

Ever since I got my Polar watch I wanted to wear it for a whole day to see how much energy I use at work. Haha, didn't expect much as the only time I get up from my seat is for a smoke break. So today I finally got around to it. I started when I left home this morning (7h30) and stopped when I pulled my car into the garage this evening (18h20).

And the stats.... *drumroll*

Total Time:             10 hours 50 mins (longer than usual)
Max [wikipedia:heart rate]:     119 bpm (unfortunately didn't notice what I got so excited about)
Avg [wikipedia:heart rate]:      72 bpm
KCal burned:          1047 kcal (4 300 kj) = about 3 Bar Ones  

So this means roughly 100 kcal/hour and that I can eat 6 chocolates/packets of chips per day and not get fat! Stick out tongue  

Posted: Jul 26 2006, 08:27 PM by Thea Burger | with no comments
Filed under: ,
CruiseControl + MsBuild + NUnit + multiple assemblies

Eventually!!! (Uncensored: Uitf*kkeneindelik)

We've been using CruiseControl.Net now for a while, but I ran into quite a few problems along the way, one of them to get everything working with 2 different test assemblies. 

Now I can't even remember everything exactly, which is a pity, because as I ran into problems I told myself, remember this, you're going to want to blog about it... but I can give you the following. 

I use a msbuild file for all the tasks that I want to execute, most importantly to execute all our tests and display the results on the CruiseControl web dashboard. At first I tried to integrate NUnit using cc.net's tasks:

<tasks>       
    <nunit>
        <path>
D:\Projects\Komodo\tools\NUnit\bin\nunit-console.exe</path>
        <assemblies> 
            <assembly>
D:\Projects\Komodo\src\Domain\Tests\bin\Debug\
                Komodo.Domain.Tests.dll
</assembly>
            <assembly>
D:\Projects\Komodo\src\Messaging\Tests\bin\Debug\
                Komodo.Messaging.Tests.dll
</assembly>
        <
/assemblies>
    <
/nunit>
<
/tasks> 

 
But for some reason that didn't wan't to work so lekker. , so I decided to rather try and do this from msbuild. Found a very useful example on Geek Noise:
 

<Project DefaultTargets="BuildAll" 
        
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>    
        <NUnitExe>
            
&quot;D:\Projects\Komodo\tools\NUnit\bin\nunit-console.exe&quot;
        
</NUnitExe>
        <NUnitArgs>
/nologo</NUnitArgs>            
    <
/PropertyGroup>  
   
    <ItemGroup>
        <TestAssembly 
Include="Komodo.Messaging.Tests.dll">        
            <WorkingDirectory>
                
D:\Projects\Komodo\src\Messaging\Tests\bin\Debug
            
</WorkingDirectory>
        <
/TestAssembly>    
        <TestAssembly 
Include="Komodo.Domain.Tests.dll">        
            <WorkingDirectory>
                
D:\Projects\Komodo\src\Domain\Tests\bin\Debug
            
</WorkingDirectory>
        <
/TestAssembly>                        
    <
/ItemGroup>       
   
     <
Target Name="BuildAll" DependsOnTargets="Clean;Compile;UnitTest;" /
     <
Target Name="Clean">
          <MSBuild 
Projects="../src/Komodo.sln" 
              
Properties="Configuration=$(Configuration)" Targets="Clean" />
      <
/Target>

      <
Target Name="Compile">
          <MSBuild 
Projects="../src/Komodo.sln" 
              
Properties="Configuration=$(Configuration)" />
      <
/Target>

      <
Target Name="UnitTest" DependsOnTargets="Compile">
          <Exec 
ContinueOnError='true' 
                  
Command='$(NUnitEXE) $(NUnitArgs) @(TestAssembly)'
                  
WorkingDirectory='%(WorkingDirectory)' />
      <
/Target>    
<
/Project>

This worked fine when I executed the build file using the command line, last thing was to ensure that the results display on the webdashboard. Now when you execute nunit from ccnet.config, the results is automatically displayed.

To display these results, you have to create a file merge task in ccnet.config. At first, in the above example I specified where to generate the nunit xml results by using <NUnitArgs>/xml D:\Projects\Komodo\build\nunit-results.xml</NUnitArgs> , but when doing this the file is obviously overwritten every time an assembly is processed. 

To solve this I just removed that line, and pointed the file merge task to the default xml results of each execution, which is the assembly's working directory:  

<merge>
    <files>        
        <file>
            
D:\Projects\Komodo\src\Domain\Tests\bin\Debug\TestResult.xml
        
</file>
        <file>
            
D:\Projects\Komodo\src\Messaging\Tests\bin\Debug\TestResult.xml
        
</file>
    <
/files>
<
/merge>      

And, TADA, eventually I have beautiful test results of multiple assemblies!  Big Smile

PS: A post that helped me a lot in setting this up initially is here on Michael Swanson's Blog.