Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtest doesn't work on build farm #75

Closed
marc-hanheide opened this issue Aug 12, 2014 · 11 comments
Closed

gtest doesn't work on build farm #75

marc-hanheide opened this issue Aug 12, 2014 · 11 comments
Assignees
Labels

Comments

@marc-hanheide
Copy link
Member

the gtests in ros_datacentre don't qualify as unit tests as they need a mongodb running on a specific port. This fails on the build farm. It should be removed or not be enabled by default, IMO.

@hawesie
Copy link
Member

hawesie commented Aug 12, 2014

Ok, will look into it. Is this for the release?

@marc-hanheide
Copy link
Member Author

yes and no... I'm actually setting up our own STRANDS build farm (it kind of works already) mimicking ROS as far as possible. The rules will be quite strict (actually the same as on ros.org):

  • every package is build in its own chroot environment
  • dependency resolution is only via rosdep
  • every build is a clean build with freshly updated debian packages (also for ROS)

If you're curious, check https://github.com/marc-hanheide/rosdistro (forked from the standard rosdistro, but now starting to add our own packages)

So, if there are unit test, they must be able to run on a freshly installed ubuntu without any manual intervention. That's also the definition of unit tests. The tests we have implemented are useful, but should be running under a different regime. I plan to do system tests as well in another STRANDS jenkins instance that then has some additional features (GPU, Mira, etc.). I don't know yet how to best configure these in the CMakeLists.txt but certainly the current gtest cannot be used (or if so, they need to start their own specific mongodb which still is problematic as ports could clash).

@hawesie
Copy link
Member

hawesie commented Aug 12, 2014

For the datacentre I am writing rostests. These are designed as integration tests, not unit tests.

To test the python parts:

rostest ros_datacentre messagestore.test

To test the cpp parts:

rostest ros_datacentre message_store_cpp.test

These both pass for me. They can also be run from catkin_make which is what I'm assuming the build farm is doing via catkin_make run_tests. The individual targets are:

catkin_make run_tests_ros_datacentre
catkin_make run_tests_ros_datacentre_cpp_client

The odd thing is that the first one works for me, but the second one doesn't try to start the datacentre although it should. Instead it ignores the launch file and runs the tests alone. I think if I can fix this problem then everything should run and test ok.

@marc-hanheide
Copy link
Member Author

Just note that it would fail if two tests are run in parallel. Eg. when
testing for both hydro and indigo on the same host. It's a but bad luck but
could happen. Or can you configure mongo to only user local sockets?
On 12 Aug 2014 16:09, "Nick Hawes" notifications@github.com wrote:

For the datacentre I am writing rostest http://wiki.ros.org/rostests.
These are designed as integration tests, not unit tests.

To test the python parts:

rostest ros_datacentre messagestore.test

To test the cpp parts:

rostest ros_datacentre message_store_cpp.test

These both pass for me. They can also be run from catkin_make which is
what I'm assuming the build farm is doing via catkin_make run_tests. The
individual targets are:

catkin_make run_tests_ros_datacentre
catkin_make run_tests_ros_datacentre_cpp_client

The odd thing is that the first one works for me, but the second one
doesn't try to start the datacentre although it should. Instead it ignores
the launch file and runs the tests alone. I think if I can fix this problem
then everything should run and test ok.


Reply to this email directly or view it on GitHub
#75 (comment)
.

@hawesie
Copy link
Member

hawesie commented Aug 12, 2014

I was adding the tests wrong. I was using the add gtest macro but I should be used add_executable and add_rostest. I'm doing this now. Once the renaming is done I will commit this too. And look at the ports issue.

@hawesie
Copy link
Member

hawesie commented Aug 12, 2014

catkin forces -j1 when running tests. Does the parallelism come from jenkins?

@hawesie
Copy link
Member

hawesie commented Aug 12, 2014

The datacentre will also need a test mode where it creates its own local directory for storage, rather than assuming a global one.

@marc-hanheide
Copy link
Member Author

Yes... Jenkins would test code for both hydro and indigo, potentially in parallel, and also for different distros.

@hawesie
Copy link
Member

hawesie commented Aug 13, 2014

Ok, will find a way to randomise ports.

@marc-hanheide
Copy link
Member Author

The merged pull request triggered a build on the new jenkins: http://lcas.lincoln.ac.uk/jenkins/job/devel-hydro-ros_datacentre/ARCH_PARAM=amd64,UBUNTU_PARAM=precise,label=devel/7/

So, we can see it built, but I had to kill the tests manually as they would wait forever...

@marc-hanheide
Copy link
Member Author

works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants