ROS + Jenkins + Automated testing setup

2 Feb
Jenkins CI

Jenkins CI server

The following Jenkins job demonstrates how to run

  1. ROS commands together with
  2. turtlesim simulator and
  3. automatic tests

Job description:

  1. The job starts the major ROS process – roscore in job’s workspace
  2. Then the job starts the turtlesim simulator
  3. The script executes three tests:
  4. Test1. It pings the turtlesim node and cheks that it responds
  5. Test2. Cheks that the turtle initial position is as expected
  6. Test3. Move the turtle and checks turtle arrived at  expected position
  7. See ROS+Jenkins bash script that executes all this


  1. You need to daemonize the  roscore and turtlesim processes in order to start the ROS environment  and the Turtlesim simulator from inside the Jenkins job.   Otherwise you get errors like: “Process leaked file descriptors”. Read more at  Spawning processes from build and download daemonize from A tool to run a command as daemon.
  2. You also need to configure Jenkins job to use the “Run Xvnc during build” option.  Otherwise Turtlesim will not start. Of course, you need first to install Xvnc plug-in to Jenkins. And also install vnc4server on your machine.
  3. Configure the Jenkins job with  “Publish  JUnit test result report”  option and print the tests results Passed/Failed in an XML file. The XML should look like this,  at StackOverflow    or see  a more general description  at Windyroad


  1. Roscore can be started as a separate process, before starting the Jenkins Job
  2. Also the turtle simulator can be started before starting the Jenkins Job – a window with a turtle in the middle will pop-up
  3. Remove from  Jenkins job the code that starts roscore and the turtle. The job contains now only pinging and moving the turtle
  4. Run the job. As a result, you will see the turtle moving around
  5. Also as a result all tests in Jenkins will Pass/Fail  as before
  6. Which means that Jenkins can easily run the failed tests and in the same time, be viewed in the simulator.

Useful Links:

  1. Get started with ROS+Gtest – Sharp Robotica Tutorial
  2. A Reference on Gtest – ROS tutorial on Gtest
  3. Gtest Primer on  Google site
  4. All tutorials on ROS
  5. Visualize a simulation started inside Jenkins (use a vncserver) – Integrate ROS and Jenkins
  6. Example on how to drive the turtle simulator from inside a C++ program

ROS Tutorials

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: