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

Generalize dartsim tests so they can run with other physics engines #50

Open
iche033 opened this issue May 1, 2020 · 8 comments
Open
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@iche033
Copy link
Contributor

iche033 commented May 1, 2020

The tests in dartsim/src directory could be generalized so we can use them for other engines like TPE.

@iche033 iche033 added the enhancement New feature or request label May 1, 2020
@scpeters
Copy link
Member

I think one approach to do this would be to create a component of ignition-physics called tests or feature-tests and add an ign physics command in that component that would load physics implementation plugins and test them somehow (can gtest be used from a library?). I've experimented with the ign plugin --info command in gazebosim/gz-plugin#32 as a proof of concept, since it uses ignition::plugin::Loader from a component library, and it seems to be working (aside from some SIP issues on macOS that can be worked around).

@scpeters
Copy link
Member

I was thinking of syntax like the following to test a single plugin with a single test:

ign physics --feature-test TestName --plugin /path/to/libPhysicsPlugin.so

If we use gtest under the hood, we may want to be able to pass through gtest command-line arguments, so that we can get junit xml files out or select a subset of test cases to run.

@mjcarroll
Copy link
Contributor

I think you could also write the tests in such a way that they load one plugin as part of the test fixture. and then execute the test.

This is similar to how it is done in ign-rendering to verify across engines: https://github.com/ignitionrobotics/ign-rendering/blob/ign-rendering4/test/test_config.h.in

@scpeters
Copy link
Member

I think you could also write the tests in such a way that they load one plugin as part of the test fixture. and then execute the test.

This is similar to how it is done in ign-rendering to verify across engines: https://github.com/ignitionrobotics/ign-rendering/blob/ign-rendering4/test/test_config.h.in

That looks similar to how osrf/gazebo handles generalized physics tests. I believe it requires the list of engines to be tested is known at configure time. To simplify the workflow for 3rd-party physics implementation plugin developers, I don't want this set of ignition-physics tests to require any knowledge of which plugins it will be tested against at configure time of ign-physics.

@scpeters
Copy link
Member

so maybe my comments go beyond the initial description of this issue, but I think it is important and will scale better for 3rd-party plugin developers

@mjcarroll
Copy link
Contributor

Ah, in that case, I suppose you could make the library a command line argument to any gtest-based test.

I'm hesitant to add a ruby dependency to be able to execute physics unit tests.

@scpeters
Copy link
Member

Ah, in that case, I suppose you could make the library a command line argument to any gtest-based test.

I'm hesitant to add a ruby dependency to be able to execute physics unit tests.

that's a fair point. If we can stuff all the test logic in a library, then perhaps we could wrap it in gtest executables for unit test purposes while still exposing it via ign physics. Best of both worlds?

@scpeters
Copy link
Member

Ah, in that case, I suppose you could make the library a command line argument to any gtest-based test.
I'm hesitant to add a ruby dependency to be able to execute physics unit tests.

that's a fair point. If we can stuff all the test logic in a library, then perhaps we could wrap it in gtest executables for unit test purposes while still exposing it via ign physics. Best of both worlds?

after some discussion with @mjcarroll, we reached roughly the following:

  • Create gtest executable(s) in the core component of ignition-physicsN that accept the path to a physics implementation plugin as a command-line argument.
  • Use add_test in the dartsim and tpe components with the path to their plugins. I'm guessing the gtest executables will need to be exported as targets for this to work?
  • Install these gtest executables to /usr/lib/ignition-physicsN/ so they can be used by ign physics test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants