Menu

Jenkins

Posts in category ‘jenkins’

Running BDD tests from TestLink in Jenkins

kinow @ Nov 07, 2012 14:26:08

Last night and this morning I spent some time working on running BDD tests that were created in TestLink in Jenkins, using testlink-plugin.

Similar integration has already been proposed in JinFeng, by Olivier Renault. Basically, you write BDD stories in TestLink (a story goes into the Test Case summary), Jenkins retrieves these stories and executes them using a skeleton project.

TestLink BDD
TestLink BDD

There are many ways to use BDD. In some of them you write code like Java, Ruby or Perl, and in others you write a DSL. I started working with JBehave, but for this integration, I preferred to use a DSL - as TestLink doesn’t maintain source code, only test cases -, so I switched to easyb.

( Read more … )

Adding coverage reports in Jenkins to GoogleTest with gcovr

kinow @ Oct 16, 2012 16:09:33

After the last post about GoogleTest and TestLink using Jenkins TestLink Plug-in, I received an e-mail asking about coverage with GoogleTest and Jenkins. I’ve just updated the Makefile in the samples directory, of the GoogleTest TAP listener project, to output coverage data.

Basically, you have to add the compiler flags -fprofile-arcs -ftest-coverage and link the executable with -lgcov. Take a look at the project’s Makefile and you’ll notice how simple it is. In order to have Jenkins interpreting your coverage report, you’ll have to convert it to cobertura XML. There is a Python utility that can be used for this: gcovr. Download it and copy it to somewhere where Jenkins can execute it (e.g.: /usr/local/bin).

Now, if you’ve followed the instructions from the previous post, you should have a job that reports your GoogleTest tests from Jenkins to TestLink using the plug-in, and is downloading the source code from GitHub. Add an extra build step (Shell) to execute gcovr.

( Read more … )

Jenkins, TestLink and GTest in 5 minutes (or so)

kinow @ Oct 11, 2012 23:44:59

This is a 5 minutes guide on creating a job for a C++ project in Jenkins with GoogleTest and reporting the test results back to TestLink, with testlink-plugin.

The test project with GoogleTest

For this simple guide we will use the samples that come with GTest TAP Listener. You can get the code from GitHub with git clone git://github.com/kinow/gtest-tap-listener.git. Take a look at gtest-tap-listener/samples/src/, there you will find two C++ files: gtest_main.cc and gtest_testHelloWorld.cc.

gtest_main.cc has the main function, and executes the test suite. And gtest_testHelloWorld.cc has the test cases and tests. Take note of the test case and tests names.

( Read more … )

Testing shell code and producing TAP using Jenkins?

kinow @ Dec 30, 2011 22:41:40

Definitely reading Hacker News before going to bed is a bad idea :-) Same goes for Reddit. So, I found a link about Bats, a tool to execute tests in Shell and output TAP - Test Anything Protocol. Then I thought; why not ask the author to include Bats under the list of Producers in testanything.org?

But you know what? Why not execute execute locally first to check if that’s working… moreover, why not use Jenkins TAP Plug-in and see what happens?

Here’s what is necessary.

( Read more … )

Building Jenkins with Eclipse and m2e plug-in

kinow @ Sep 20, 2011 17:50:04

Yesterday I finally managed to build Jenkins using Eclipse and m2e plug-in. With Eclipse Indigo release came a new version of the Maven plug-in for Eclipse (former M2Eclipse), m2e. Since I started using Eclipse Indigo and this new plug-in I hadn’t been able to build Jenkins in Eclipse anymore.

I’ve been having a terrible fever and thought that it would be a good thing to stop playing Minecraft for a while and find a way to build Jenkins in Eclipse + m2e :-).

1. Maven Plug-ins execution in project life cycle

The first thing I’ve noticed were the messages regarding the execution of some Maven plug-ins in the project life cycle. m2e delegates the execution of Maven plug-ins to an external executor. As not all Maven plug-ins have an existing executor for m2e you will receive a message similar to “Plugin execution not covered by lifecycle configuration: …”.

( Read more … )