Integrating RVS with Bamboo

In this post, we describe how to integrate the RVS plugins RapiTest and RapiCover with Bamboo, the continuous integration system from Atlassian.

If one or both of these RVS tools is already integrated into your build system and your builds are managed by Bamboo, you can integrate them with Bamboo so that Bamboo tracks unit test and/or code coverage data and archives a report for each build it runs.

Pre-requisites

To begin, we assume that you already have a Bamboo job that runs RapiTest and/or RapiCover on your code and produces an RVS report.

If you want to integrate RVS with Bamboo, contact us and we'll send you an RVS installer that includes additional scripts and features necessary for the Bamboo integration.

Add a task to convert RVS results to XML

First, add a new task to the job that runs RVS on your code to convert your RVS results to an XML format for further processing. To do this, click the edit button for your existing build plan, then select the job that runs RVS.

Click Add task to configure a new task. Select Script and enter one of the scripts below, using the default settings:

If you're integrating with RapiTest only:

set RVSPATH=<path_to_RVS_installation>
set RVDFILE=<path_to_your_rvd_file.rvd>
set DEST=%bamboo_build_working_directory%\target\site
set RT2JUNIT=<path_to_rt2junit.py>
md %bamboo_build_working_directory%\target
md %bamboo_build_working_directory%\target\site
md %DEST%\junit_results
md %DEST%\rvs
REM Archive the RVS report
copy /y %RVDFILE% %DEST%\rvs\
REM Create the test summary from the RapiTest report
%RVSPATH%\bin\testexport.exe %RVDFILE% --fmt xml -o %TEMP%\tests.xml
REM Create the test summary in JUnit format from the RapiTest export
python.exe %RT2JUNIT% %TEMP%\tests.xml -o %DEST%\junit_results\junit
      

If you're integrating with RapiCover only:

set RVSPATH=<path_to_RVS_installation>
set RVDFILE=<path_to_your_rvd_file.rvd>
set DEST=%bamboo_build_working_directory%\target\site
md %bamboo_build_working_directory%\target
md %bamboo_build_working_directory%\target\site
md %DEST%\clover
md %DEST%\rvs
REM Archive the RVS report
copy /y %RVDFILE% %DEST%\rvs\
REM Create the clover summary from the RapiCover report
%RVSPATH%\bin\covexport.exe %RVDFILE% --fmt clover -o %DEST%\clover\clover.xml
      

If you're integrating with both RapiTest and RapiCover:

set RVSPATH=<path_to_RVS_installation>
set RVDFILE=<path_to_your_rvd_file.rvd>
set DEST=%bamboo_build_working_directory%\target\site
set RT2JUNIT=<path_to_rt2junit.py>
md %bamboo_build_working_directory%\target
md %bamboo_build_working_directory%\target\site
md %DEST%\clover
md %DEST%\rvs
md %DEST%\junit_results
REM Archive the RVS report
copy /y %RVDFILE% %DEST%\rvs\
REM Create the test summary from the RapiTest report
%RVSPATH%\bin\testexport.exe %RVDFILE% --fmt xml -o %TEMP%\tests.xml
REM Create the test summary in JUnit format from the RapiTest export
python.exe %RT2JUNIT% %TEMP%\tests.xml -o %DEST%\junit_results\junit
REM Create the clover summary from the RapiCover report
%RVSPATH%\bin\covexport.exe %RVDFILE% --fmt clover -o %DEST%\clover\clover.xml
      

Convert XML results to a viewable output format

You now need to convert your XML results into a viewable output format. This works slightly differently for RapiTest and RapiCover, as described in the following sections.

Converting XML results for RapiTest

In your job configuration, click Add task. Select JUnit Parser, configure the settings shown below, then click Save.

Converting XML results for RapiCover

In the Miscellaneous tab of your job configuration, check Use Clover to collect Code Coverage for this build and set the Clover XML Location to target\site\clover\clover.xml.

Archive RVS reports

To configure Bamboo to archive RVS reports from your builds, open the Artifacts tab, click Create definition, and add the artifact shown below.

Build and collect RVS data

When you run the plan you configured, the job(s) will be executed at the end of the build and your reports will be saved.

You can now access detailed RVS reports for each build in the Artifacts tab, view trends from your builds in the Reports menu, and detailed data for each build.

If you're using RapiTest, you can view unit test trend data by selecting Number of tests from the Reports menu on your build. If you're using RapiCover, you can view coverage trends by selecting Clover Code Coverage from this menu.




  • Unit test results: detailed results per build



  • Coverage results: coverage trend over time

If anything goes wrong, you can identify the issue using the log for the job.

Notes:

  • Requires RVS version 3.3a minimum
  • Tested on Bamboo version 5.8.1
Mahy Diaz

Receive our blog by email