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

Unit tests CMake and Travis refactoring #1786

Merged
merged 2 commits into from
May 30, 2017

Conversation

SergioRAgostinho
Copy link
Member

@SergioRAgostinho SergioRAgostinho commented Dec 25, 2016

Hey everyone, here's my Christmas 🎁 :) This PR addresses the following:

  • The unit tests CMake files were changed to allow: running the test for a certain module, as long as the module is build; specify if the tests for a certain module should be built.
  • All dependencies in travis are now installed directly from aptitude.
  • The full build now also builds tools, examples, apps and the simulation module which was previously not being built I think.
  • I split the unit tests on travis into two jobs. I packed things together in a way that ensures that all dependencies are met (even the new optional ones), so that all tests run. The new "test-extended" job is running on a somewhat tight schedule, so it might need some off-balancing somewhere in the near future, but this should be enough for now.

Modules test dependencies (optional in parenthesis):

  • common: (io features)
  • geometry: common
  • ml: common
  • octree: common
  • io: octree (visualization)
  • kdtree: common (io)
  • search: kdtree octree (io)
  • visualization: io search (features)
  • sample_consensus: search (io)
  • filters: sample_consensus (io features segmentation)
  • outofcore: io filters visualization
  • 2d: io filters
  • features: filters 2d (io keypoints)
  • registration: features (io)
  • keypoints: features (io)
  • surface: search (io features filters)
  • segmentation: geometry features ml
  • people: visualization segmentation
  • recognition: io registration ml

Test Matrix

Core Extended
common: (io features) filters: sample_consensus (io features segmentation)
geometry: common registration: features (io)
octree: common surface: search (io features filters)
kdtree: common (io) segmentation: geometry features ml
io: octree (vtk) people: visualization segmentation
search: kdtree octree (io) recognition: io registration ml
sample_consensus: search (io)
visualization: io search geomtry (features)
2d: io filters
outofcore: io filters visualization
keypoints: features (io)
features: filters 2d (io keypoints)

Updated

Core Extended 1 Extended 2
common: (io features) io: octree (vtk) filters: sample_consensus (io features segmentation)
geometry: common visualization: io search geomtry (features) segmentation: geometry features ml
octree: common outofcore: io filters visualization people: visualization segmentation
kdtree: common (io) registration: features (io) recognition: io registration ml
search: kdtree octree (io) surface: search (io features filters)
sample_consensus: search (io)
2d: io filters
keypoints: features (io)
features: filters 2d (io keypoints)

Closes #1785.

Merry Christmas 🎅

@SergioRAgostinho SergioRAgostinho added the needs: code review Specify why not closed/merged yet label Dec 25, 2016
@SergioRAgostinho SergioRAgostinho added this to the pcl-1.8.1 milestone Dec 25, 2016
@taketwo
Copy link
Member

taketwo commented Dec 25, 2016

Hi Sergio, great work! I'll have a detailed look once I'm back in the office next week. Merry Christmas!

.travis.yml Outdated
@@ -33,7 +33,8 @@ env:
matrix:
include:
- compiler: gcc
env: TASK="test"
env: TASK="test-core"
- env: TASK="test-extended"
Copy link

@maflcko maflcko Dec 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to set the compiler for this task* as well. Otherwise you might end up with ["gcc", "clang"] set as compiler, I think?

* same for doc

@maflcko
Copy link

maflcko commented Apr 4, 2017

fyi, I've been running the segmentation module without issues for a couple of months now.

@SergioRAgostinho
Copy link
Member Author

Hey guys :) Can I get a volunteer to have a look at these? I have some spare time the next two weeks and wanted to have the tests running before starting to review PRs.

Copy link
Member

@taketwo taketwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see that last commit of Marco running on Travis, but somehow it does not pick it up and still runs the broken version: https://travis-ci.org/PointCloudLibrary/pcl/jobs/186595213

ARGUMENTS "${PCL_SOURCE_DIR}/test/cturtle.pcd")
set(SUBSYS_NAME tests_keypoints)
set(SUBSYS_DESC "Point cloud library keypoints module unit tests")
set(SUBSYS_DEPS global_tests keypoints common search kdtree octree features filters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you decide which modules are SUBSYS_DEPS for a particular test subsystem?

Copy link
Member Author

@SergioRAgostinho SergioRAgostinho Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mimic the dependencies from the library/module they belong i.e.: test_keypoints has all the deps the module keypoints has. I don't remember exactly why I added all the recursive dependencies explicitly, but I think it's to ensure the include directories and link flags are properly defined when creating each individual test target.

It's been a while now, my memory is not that fresh :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for this delay in reviewing!
So basically these are propagated from the respective module under test. Do you recall any reasons this can not be done automatically? Would definitely improve maintainability.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the massive delay 😅 . I found a way to mimic the behaviour you described, to I'm applying the changes now. The doxygen issue after...

- libqhull-dev
- libvtk5-dev
- libflann-dev
- doxygen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This brings us an ancient version of Doxygen from 2011 (1.7.6 to be precise). Apart from gazillion bug fixes, one useful feature that is missing there is Markdown support. Back in the day I even made a PR (#526) to get a newer version. I'm not sure how much of PCL docstrings are actually written with Markdown, but the fact that I made that request suggests that there are at least some.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks exactly like the solution we need. Doxygen packages backported for Precise. It will bump the version to 1.8.8 which already has markdown support.

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented Apr 18, 2017

I'd like to see that last commit of Marco running on Travis, but somehow it does not pick it up and still runs the broken version: https://travis-ci.org/PointCloudLibrary/pcl/jobs/186595213

You're right. I'll have a look later today.

@SergioRAgostinho
Copy link
Member Author

I'd like to see that last commit of Marco running on Travis, but somehow it does not pick it up and still runs the broken version: https://travis-ci.org/PointCloudLibrary/pcl/jobs/186595213

So there's an issue with that given this particular line, since this is in fact a pull request

if [[ $TRAVIS_PULL_REQUEST != 'false' ]]; then exit; fi

But there's still something off, even with the CI job on my local fork. Is there any reason for us to clone the doc repo like this

git clone git@github.com:PointCloudLibrary/documentation.git .

instead of through the usual url? That one ended up failing in my local CI job because it requested me to enter an RSA password (which I assume is somehow encoded in all those 'secure' lines in the travis.yml).

@taketwo
Copy link
Member

taketwo commented May 17, 2017

We clone via SSH to later allow password-less push of the newly generated docs.
Perhaps for testing we can move this line in question further down, so that only final push is skipped? And before merging this PR move it back.

@SergioRAgostinho
Copy link
Member Author

Let me give it a try then

@SergioRAgostinho
Copy link
Member Author

It's suffering from the same issue as my local job (which is expected). A password is prompted to access the RSA file which results in the job hanging and eventually failed due to lack of output for 10 minutes.

Any ideas on how to overcome this?

@maflcko
Copy link

maflcko commented May 17, 2017 via email

@taketwo
Copy link
Member

taketwo commented May 17, 2017

Marco probably meant https://github.com/PointCloudLibrary/documentation.git

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented May 17, 2017

I did that before, here's the job output on that one (it's from my forks CI but that's pretty much equivalent)
https://travis-ci.org/SergioRAgostinho/pcl/jobs/233205797
It builds, it simply can't push (as expected).

@taketwo
Copy link
Member

taketwo commented May 17, 2017

Ok, then I think this part is fine.
But as far as I can see, in the meanwhile the extended test job started to consistently time out.

@SergioRAgostinho
Copy link
Member Author

But as far as I can see, in the meanwhile the extended test job started to consistently time out.

  • 'test-extended' is the one which is failing most consistently from time out
  • 'test-core' has an actual test failing and on this last one it took 13 minutes more than usual, timing out.

These timing fluctuations are cumbersome. I guess the underlying point you're trying to make is, to reconsider splitting the current tasks even more.

@taketwo
Copy link
Member

taketwo commented May 17, 2017

Well yes, that is the only thing that prevents us from merging.

@SergioRAgostinho
Copy link
Member Author

Updated the table and test batches. Tried to run again make with -j2. It might run out of memory but let's see.

@SergioRAgostinho
Copy link
Member Author

SergioRAgostinho commented May 17, 2017

It should be stable for a while now. I opted to partition the building of apps, examples and tools into their own individual jobs, to ensure the best probabilities of not running out of time.

Now it's a matter of deciding which commits to squash (especially these last ones).

@taketwo
Copy link
Member

taketwo commented May 18, 2017

Seems to work now! Indeed, makes sense to squash some of the latest commits.

Regarding the failing test case: it tests the behavior of concatenatePointClouds in presence of "padding" fields. Unfortunately, the expected behavior is not documented, so we can only guess from the code how it is supposed to work. After a quick look-through, I think the rgb field should remain unititialized, so it's not clear why it is being tested for equality to zero and why this succeeded before. Well anyway, it's a separate issue.

@SergioRAgostinho
Copy link
Member Author

Seems to work now! Indeed, makes sense to squash some of the latest commits.

So after the review process is complete (not sure if you're done with it), I would propose to squash everything into two main commits: one pertaining the test refactoring (CMake and source files) and the other one related to the changes done in Travis script and configuration files.

@MarcoFalke If I squash your commit it will omit your contribution. Would this be a problem? I can always try to keep it separate during the rebase process.

@maflcko
Copy link

maflcko commented May 18, 2017 via email

- Include directories are now added for opt dependencies
- Make module dependencies propagate to the corresponding tests
- install dependencies from package manager
- Full build now also builds simulation, apps and examples
- tests refactoring, now split into core and extended
- Specify compiler explicitly on all jobs, reset author and date for docs (author @MarcoFalke)
- Add ppa of backported doxygen for Precise. Allows having a more recent version than the default one on Precise which already supports markdow.
- Prevent doc push in case of a pull request
- Refactor into three test blocks
- Limit the number of jobs in the extension tests
- Refactored compilation of lib, apps, tools and examples
@SergioRAgostinho
Copy link
Member Author

Et voilá. Let's allow it to run and then finally conclude this guy 😄

@taketwo
Copy link
Member

taketwo commented May 19, 2017

@jspricke fine to merge?

@jspricke
Copy link
Member

Thanks a lot guys and sorry for keep you waiting :).

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

Successfully merging this pull request may close these issues.

4 participants