Skip to content

fix(ci): unit tests are not launched

Flavien BRIDAULT requested to merge 713-ci-unit-tests-are-not-launched into dev

Description

The code with flock was wrong, and the test was not executed. I restored the initial code, which should be safe.

Also, I think there was another specific bug with viz_scene3d test. Even on my computer, it crashed after destroying the first Ogre::Root. Indeed we chose to create and destroy it after each test. This problem is thus independent from the display number of xvfb-run since it does succeed to create an OpenGL context once but somehow fails to create a second. I assume xvfb-run might be buggy regarding this initialization code.

As a workaround, I propose to create a single Ogre::Root for the whole test suite. There are 3 ways to achieve this:

  1. create and destroy the Ogre::Root in a static singleton. That crashes, because Ogre::Root fails to destroy properly after the main() function.
  • create and destroy the Ogre::Root in an initialize/uninitialize function inside the main function. We do not have such a system today.
  • create and destroy the Ogre::Root in a plugin, which somehow mimics the previous solution, but we already have the system in place.

So I implemented the third solution and introduced a new module sight::module::viz::scene3d::test to this end.

Closes #713 (closed)

How to test it?

You can manually modify the code at the end of template_test.sh.in to force the usage of xfvb-run when running ctest -jN and verify it never crashes because a display number is already in use.

Edited by Flavien BRIDAULT

Merge request reports