This project is read-only.

Integration with CruiseControl.Net

Apr 3, 2010 at 9:58 PM

Has anyone managed to integrate StoryQ with CruiseControl.Net? I assume you can merge the StoryQ.xml file into the build results. Does anyone know how to view the results on the web dashboard? I am hopeless at XSLT :)

Coordinator
Apr 4, 2010 at 10:26 PM

hi p3365

I've never actually tried to integrate StoryQ with CC. But the easiest scenario is to simply serve the xml and xslt files from your build server. That way, anyone can go ahead and view the html report directly on the server. With teamcity, we've got this set up as a build artifact, which means that every build provides an easy link to the StoryQ report (it shows up as a tab on the build details page). No need to do any custom xml processing...

This link might help (but i'm only guessing, it's been a long time since i've used CC): http://confluence.public.thoughtworks.org/display/CC/Getting+Started+With+CruiseControl#GettingStartedWithCruiseControl-artifact

Hope that helps - Rob

Apr 6, 2010 at 8:23 PM

Thanks Rob. I have never tried build artifacts so I'll try it when I am back at work next week.

Coordinator
Apr 7, 2010 at 9:43 AM

Cool - If it works, can you let us know the steps you took? I'll put together a wiki page on it for other users...

Apr 13, 2010 at 2:46 PM

Right. Finally got StoryQ working with CruiseControl.Net. Its really cool :) Essentially:

Once my unit tests have run, the build copies the storyq.xml file into the build results directory. All of our build results have the format *-results.xml, so I rename the output to follow that convention. So, to do this I run the following nant task:

<copy
    file="${path::combine(unittests.dir, 'StoryQ_Report\StoryQ.xml')}"
    tofile="${path::combine(results.dir, 'storyq-results.xml')}"
    />

where 'unittests.dir' and 'results.dir' are the locations of the unit test output and build results respectively.

The CruiseControl.Net config file (ccnet.config) is configured to pick up all of my build results and combine them into my build log, so I didn't need to make any changes here:

<publishers>
	<merge>
    		<files>
			<file>results\*-results.xml</file>
		</files>
	</merge>
	<xmllogger />
	<statistics />
</publishers>

To provide a summary report I created a 'storyq-summary.xsl' file to process the build results and create the summary results. This is copied to the webdashboard \xsl subdirectory.

I then added the the following lines in the webdashboard \dashboard.config file:

<buildReportBuildPlugin>
        <xslFileNames>
          <xslFile>xsl\storyq-summary.xsl</xslFile>
        </xslFileNames>
      </buildReportBuildPlugin>

 

To allow access to StoryQ's detailed output I had to do some 'manipulation' of the StoryQ-SimpleHtml.xslt to get it to work with CruiseControl.Net. The one provided with StoryQ nearly works, but spits out some random garbage at the top of the page (this was the contents of the CruiseControl build file!!), and also there are some issues with using the styling on standard html elements such as <table> and <h1> etc..

I am a beginner at xslt, but I got this working properly by creating a new template at the top-level and fixing the styles to use css classes. I then renamed it as 'StoryQ-SimpleHtml.xsl' and copied it to CruiseControl's 'webdashboard\xsl' subdirectory.

I then added the the following lines in the webdashboard\dashboard.config file:

<xslReportBuildPlugin description="StoryQ Report" actionName="StoryQBuildReport" xslFileName="xsl\StoryQ-SimpleHtml.xsl" />

So I have create two extra files, storyq-summary.xsl and StoryQ-SimpleHtml.xsl that are required to be able to view the results in the CruiseControl.Net web portal. I can send them if required.

StoryQ is now fully integrated with CruiseControl.Net and I can make myself a cup of tea :)

 

Coordinator
Apr 13, 2010 at 4:43 PM

Hi p3365

Just to clarify: is this what you did to make the storyQ output appear as a cruise control webpage? That's pretty cool - can I see a screenshot?

All we've been doing is creating a hyperlink to the storyq XML (so the user doesn't have any teamcity / cruise control "chrome" around the results, they have to navigate with the browser's back button)

Apr 13, 2010 at 5:10 PM
Edited Apr 13, 2010 at 5:11 PM

Yes.

You get an extra StoryQ summary block on each build. This shows the number of stories in the current build that have passed, pending or failed. If any stories are pending or failed then they are listed (not the scenarios, just the name of the stories).

You also get a "StoryQ" link on the left hand side of each CruiseControl build. If you click on that link  the Simple Html report appears (this is integrated into the CruiseControl web page "chrome").

Where do you want me to send the screen shots? I will send them when I am back at work tomorrow. Of course, I can also send all xsl files to you if you would like to make them available to others.

Coordinator
Apr 13, 2010 at 5:17 PM

Huh: I was assuming you could upload images to these forums (like you can with everything else on codeplex)

Can you please email the images and XSLs to me? rob at robfe dotcom

Are you ok for me to write a wiki page detailing this process and offering the XSL for download? How would you like me to credit you ("username P3365" or perhaps another name)?

 

Apr 13, 2010 at 5:29 PM
Edited Apr 13, 2010 at 5:30 PM

Yes, of course I am OK for you to write a wiki page on it. If you wish to credit me, then use my real name - "Paul Wardle". I'll send the files/screen shots in the morning.

Apr 14, 2010 at 11:06 AM

I have just sent some screenshots and the xsl files to your email. For the record, here’s an additional step I missed out of the above forum post:

To see the StoryQ output on the CruiseControl.Net web dashboard you always need to copy the StoryQ output. To do this, I use a little helper from Nant.Contrib project, so I can copy out the StoryQ results even if the tests fail (and an exception is thrown).

The Nant script should be self-explanatory:

<!-- ################################## -->
<!--  This target runs acceptance tests -->
<!-- ################################## -->
<target name="acceptancetests">

  <property name=" acceptancetests.dir.filetemplate" value="${path::combine(acceptancetests.dir, '**Tests.dll')}" />

  <echo>Running acceptance tests from: = ${acceptancetests.dir.filetemplate}</echo>

   <trycatch>
      <try>
          <nunit2>
              <formatter type="Plain" />
              <test>
                  <assemblies>
                      <include name="${acceptancetests.dir.filetemplate}" />
                  </assemblies>
              </test>
          </nunit2>
      </try>
      <finally>
         <copy
            file="${path::combine(acceptancetests.dir, 'StoryQ_Report\StoryQ.xml')}"
            tofile="${path::combine(results.dir, 'storyq-results.xml')}"
          />
      </finally>
  </trycatch>

</target>


Mar 16, 2011 at 7:14 AM

Hi Rob,

Would you consider making the CC.NET files that Paul referred to above available to others? I'd like to give integration with CC.NET a go. I really love StoryQ, by the way (apart from having to remember to call

.ExecuteWithReport(MethodBase.GetCurrentMethod())
with each test!)