LiquidTest and Cruise Control.NET
In this article we will step through the setup and configuration of a LiquidTest Server installation w/ CruiseControl.NET
Ensure you have the following pre-requisites installed:-
We are going to install and configure the following pieces of software:
You don't specifically require IIS installed to run the CruiseControl.NET dashboard, we can make use of the ASP.NET web server that comes with Visual Studio. Infact, if you do not have IIS installed on your local machine already, I would recommend leaving it that way.
Windows Vista / Windows 7
If you want to install IIS, go to Control Panel | Programs | Turn Windows features on or off, and install “Internet Information Services”, making sure that “Application Development Features” have been checked.
Windows XP
Go to the Windows XP Control Panel | Add Remove Programs | Add Remove Windows Components and check “Internet Information Services”
REMEMBER TO APPLY ANY SERVICE PACKS TO THE OPERATING SYSTEM AFTER INSTALLING IIS
Download CruiseControl.NET 1.5 RC1 and execute the setup.
I installed it to C:\Tools\CruiseControl.NET. I did not install it as a Windows service, we'll just run it manually as required. However, I would recommend installing it as a system service in if you are setting up a proper dedicated CI server.
Once you have the CC server installed, launch it via the shortcut it created on your desktop.
When CruiseControl.NET starts up it should mention something about having “no projects found.”, that's expected, we are going to modify the config file a little later. The server will detect any changes we make and reload the config file accordingly, so we can just leave the CC.NET console running.
We'll now setup the dashboard web app. If you're on Windows XP and you chose to install IIS, the installer probably configured the dashboard correctly for you. but I'm on Windows 7 / IIS7 and it didn't seem to work.
If you chose to skip the IIS installation and use the Visual Studio Web Server
Assuming you installed CruiseControl.NET into C:\Tools\CruiseControl.NET run the following command:
"C:\Program Files\Common Files\microsoft shared\DevServer\9.0\WebDev.WebServer.EXE" /port:8080 /path:"C:\Tools\CruiseControl.NET\webdashboard" /vpath:"/ccnet"
You should see a system tray baloon like the following one:
If you did, you can now browse to http://localhost:8080/ccnet
If you are running IIS
Open up IIS Manager, go to the default website, right click on the default website, and click “Add Application”
Alias: ccnet
Phys Path: C:\Tools\CruiseControl.NET\webdashboard
Hit OK, then see if you can browse to http://localhost/ccnet
If everything is working, you should see the CC.NET Web Dashboard in your browser…
We'll configure it now too, hit “Administer Dashboard”, the default password is ccnetrocks..
In the “Packages” list, click “NUnit Results”, and install it.
Create the following directory structure:
C:\LiquidTestDotNet
C:\LiquidTestDotNet\ci
C:\LiquidTestDotNet\svn (our subversion repository)
C:\LiquidTestDotNet\working (We'll be making changes to this working copy)
Now right click on the “svn” folder, and using Tortoise SVN “Create repository here”
Then right click on the “working” folder, and select “SVN Checkout”
enter the url:
file:///C:\LiquidTestDotNet\svn
Hit ok. We should now have a fully functional SVN repository that we can commit changes to.
Lets go add a very simple batch file to source control, so that CC.NET will have something to do when we configure it.
Create a new file called build.bat in C:\LiquidTestDotNet\working with the following contents:
@ECHO OFF
echo Hello World
add it to subversion (Right click file | TortoiseSVN | Add…)
and commit (Right click | SVN Commit)
Now we need to configure CruiseControl.NET!
Lets go create a very simple build configuration to start with that connects to subversion, and pulls down our batch file, and executes it:
<project name="LiquidTestDotNet">
<sourcecontrol type="svn">
<trunkUrl>file:///C:/LiquidTestDotNet/svn</trunkUrl>
<workingDirectory>C:\LiquidTestDotNet\ci</workingDirectory>
</sourcecontrol>
<triggers>
<intervalTrigger seconds="180" />
</triggers>
<tasks>
<exec>
<executable>C:\LiquidTestDotNet\ci\build.bat</executable>
</exec>
</tasks>
</project>
cut and paste that project configuration into your CC.NET config file: C:\Tools\CruiseControl.NET\server\ccnet.config.
When you hit save, the server should detect the change, and reload the configuration
CruiseControl.NET Should check out the repository, and execute our build script.
Now we can jump on in and start our liquid test stuff now, but we still don't have MSBuild or NUnit configured.
I've set up a basic project that you can download and unzip into your working directory you can download it from
LiquidTestExample.zip
.
Unzip it, and add it to your Subversion repository.
Open up the Visual Studio solution edit the liquidtest.properties file
licenseKey=<valid server license key>
Right click on it in visual studio, and select its properties, and set the “Copy to Output Directory” to the value of “Copy if newer”
The end result should look something like this on the file system:
C:\LiquidTestDotNet\working\LiquidTestExample.sln
C:\LiquidTestDotNet\working\LiquidTestExample\LiquidTestExample.cs
C:\LiquidTestDotNet\working\LiquidTestExample\LiquidTestExample.csproj
C:\LiquidTestDotNet\working\LiquidTestExample\liquidtest.properties
C:\LiquidTestDotNet\working\LiquidTestExample\Properties\AssemblyInfo.cs
Now we need to create an MSBuild build script that will execute NUnit via Exec:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="BuildAll" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LiquidTestSolution>.\LiquidTestExample.sln</LiquidTestSolution>
<NUnitExe>"C:\Tools\nunit-2.5.3\bin\net-2.0\nunit-console-x86.exe"</NUnitExe>
<NUnitArgs>/nologo</NUnitArgs>
</PropertyGroup>
<ItemGroup>
<LiquidTestAssembly Include="LiquidTestExample.dll">
<WorkingDirectory>.\LiquidTestExample\bin\Debug</WorkingDirectory>
</LiquidTestAssembly>
</ItemGroup>
<Target Name="BuildAll" DependsOnTargets="Clean;Compile;UnitTest;" />
<Target Name="Clean">
<MSBuild Projects="$(LiquidTestSolution)" Properties="Configuration=$(Configuration)" Targets="Clean" />
</Target>
<Target Name="Compile">
<MSBuild Projects="$(LiquidTestSolution)" Properties="Configuration=$(Configuration)" />
</Target>
<Target Name="UnitTest" DependsOnTargets="Compile">
<Exec ContinueOnError="true" Command="$(NUnitExe) @(LiquidTestAssembly) $(NUnitArgs)" WorkingDirectory="%(WorkingDirectory)" />
</Target>
</Project>
Save it as LiquidTestExample.msbuild.
Now commit the changes to the Subversion repository.
Now we'll change the CCNet config file to automatically build our project we just added.
<project name="LiquidTestDotNet">
<workingDirectory>C:\LiquidTestDotNet\ci</workingDirectory>
<artifactDirectory>C:\LiquidTestDotNet\artifacts</artifactDirectory>
<sourcecontrol type="svn" autoGetSource="true">
<trunkUrl>file:///C:/LiquidTestDotNet/svn</trunkUrl>
<workingDirectory>C:\LiquidTestDotNet\ci</workingDirectory>
</sourcecontrol>
<triggers>
<intervalTrigger seconds="180" />
</triggers>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\LiquidTestDotNet\ci</workingDirectory>
<projectFile>LiquidTestExample.msbuild</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug</buildArgs>
<targets>BuildAll</targets>
<timeout>60</timeout>
</msbuild>
<merge>
<files>
<file>
C:\LiquidTestDotNet\ci\LiquidTestExample\bin\Debug\TestResult.xml
</file>
</files>
</merge>
</tasks>
</project>
Once we save the ccnet.config file again, the CruiseControl server should pick up the new project/build configuration, and execute MSBuild, compiling our LiquidTestExample project, and executing the LiquidTest Test Cases.
Now you can record new LiquidTest Test Cases inside of Visual Studio, and once you are done recording test cases (and running them), you can commit your changes to your Subversion repository, and your build server will execute all the test cases in the project.
|
|
News / Events
|
|
|
|
|
|
|
|
Recently Added Content
|
|
|
|
|