The Cult of Gary

07 Nov

Atlassian Bamboo and Perl Test Harness

At my current gig, we use Atlassian Bamboo as a Continuous Integration server. It plugs into the rest of our Atlassian tools, which is nice.

It took me a bit to get my perl test cases to work with it, but with the help of TAP::Harness::JUnit, I finally got it to work. It’s really easy too:

  1. Install TAP::Harness::JUnit
  2. Put the following script into you code repository. Put it somewhere that you can call it easily when doing a build.
    #!/usr/bin/perl
    use strict;
    use warnings;
    use TAP::Harness::JUnit;
    my $outputfile = shift;
    my $harness = TAP::Harness::JUnit->new({
    xmlfile => $outputfile,
    });
    $harness->runtests(@ARGV);
  3. Instead of calling make test for you perl modules, run:
    perl $SCRIPTFROMABOVE -Iblib/lib $OUTPUTFILE t/*.t

$OUTPUTFILE should be an xml file in whatever directory you have configured Bamboo to look in for test reports.

This should work with any CI server that can read JUnit xml output.

One Response to “Atlassian Bamboo and Perl Test Harness”

  1. 1
    Edwin (Atlassian) Says:

    Hi Gary,

    This is really cool. Thanks for sharing!

    Please let us know if/how we can make Bamboo even easier to set this up.

    Cheers,
    Edwin

Leave a Reply

© 2010 The Cult of Gary | Entries (RSS) and Comments (RSS)

GPSwordpress logo