-
Notifications
You must be signed in to change notification settings - Fork 317
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
[all] Refactor SofaTest to cut dependencies #471
[all] Refactor SofaTest to cut dependencies #471
Conversation
The idea is to have simple and basic testing in core then create variant of these when we want to do InSimulation tests. The old SofaTestMessageHandler is now forwarding to the base class.
…r NumericTest This is better than using ::testing because they catch msg_error message and convert them into error. So by doing that all our tests have a consistant behavior.
…test Some tests in framework makes uses of full simulation. They are thus move into the right directory and are now inheriting from BaseSimulationTest.
One possible next-step could be to connect the BaseSimulationTest with the simpleapi work discussed with @maxime-tournier. So that we would have a fully loosed coupling equivalent to scenecreator and sofatest with good looking syntax. |
…void link problem on windows.
…gin SofaAllCommonComponents. The idea is that we can load all the common component through the plugin manager or a RequirePLugin in the scene.
This approach make use of the factory and text description of the object se don't need to include them.
…dency to SofaTest NB: there is still a dependency to SceneCreator & the test should really be rewritten using simpleapi or anything else :)
…lCommonComponents instead.
…tatic dependency.
I believe whatever the approach taken it should allow to keep things pretty clear between
|
Hello François (@fjourdes), Thank for the long and interesting reply. Your last comment rise an interesting question related to differentiating unittest to functionnal tests. Here is a proposal. This would make things very clear, be compatible with your workflow where unit test are considered as compilation failure, be compatible with our workflow where functional tests are used because they allow to get decent code coverage and last point as it would use the loose coupling approach it would totally cut the dependency at compile time to SofaTest. Small note, some Functional tests may rely on components implemented in plugins. I have not clear view if we should disable the test if the plugin is not there or if we should make it fails or if we should "disable" it at runtime. EDIT: changes some sentences. |
… because of failed merged.
…t consistant with Sofa.
From what I understand, we have 2 different topics here.
To resume my point of view:
In parallel, open the "always run unit-tests" discussion on a separate topic. |
My change is not a regression. Builds are now failing when unit tests crash for an unexpected reason (not due to the test itself). |
@guparan No problem guillaume and you are totally right with that. |
8a7cffb
to
116320c
Compare
…failing. This PR is making the PluginManager inheriting from BaseTest which by default generate test failure when an error message is emitted. The existing tests were not specifying the behavior regarding the messages. It is now fixed.
[ci-build][build-scenes] |
[ci-build][with-scene-tests] |
Maxime (@maxime-tournier) |
Hi @damienmarchal, will look into it ASAP, but I don't have much time these days unfortunately :-/ |
@maxime-tournier I would alreay be happy with a feedback on the approach taken to cut the depdencies. I'm asking because I know the topic interests you. |
…ink, BindingSofa The added tests files are working in a way close to the existing one in SofaTest but: - I wanted to implement tests for the recently added function needed by PSL without refacting the whole python test framework right now. So it is currently not factorized with the SofaTest approach Unifying/cleaning everything will be a future work (once sofa-framework#471 is merged)
@hugtalbot , @guparan and everyone else
I suggest to have a last look at it & merge it rapidly that we can start working on top of it to improve it and to remove all the dependencies to SofaTest. |
@@ -354,6 +355,9 @@ endif() | |||
## Plugins | |||
add_subdirectory(applications/plugins) | |||
|
|||
## Packages | |||
add_subdirectory(applications/packages) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damienmarchal could you explain why this folder has been created ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that for the unit tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Hugo,
Sure,
The goal of the PR is to cut the dependency between tests & core+modules. My problem was that modules are not plugins which was annoying to loose the dependency graph. So I decided to make plugin containing only the modules initialization so when you load the plugin the underlying modules get initialized properly. This is what packages/SofaAllCommonComponent is doing.
I created the folder packages to put this SofaAllCommonComponent to differentiate this from other real plugins that actually contains code.
Now, putting that in perspective I think this should and will be remove while we are moving toward the full pluginization and sofaNG re-organization.
This is a variation of the proposal done by @fjourdes in #455 where I allow me a bit more refactoring.
Here is what the PR does:
The consequences are:
Feel free to provide feedback/comment.
This PR:
Reviewers will merge only if all these checks are true.