Best Practices for Writing Eclipse Tests #3041
-
Dear members of the Eclipse Tycho-User community, Our team is facing an important decision regarding the writing of Eclipse tests, and we would like to benefit from your collective experience and expertise. Currently, due to historical reasons, we have a test plugin that contains the test code for approximately 80 Eclipse plugins (part of our Eclipse RCP prodcut). To improve our structure, we plan to split this test plugin. However, we are uncertain about which approach represents best practices: a) Placing the test code in Maven style under src/test/java within the production code plugin. b) Creating the test code as a test fragment separately from the production code plugin, which would result in approximately 80 new test fragments. After reviewing the Tycho release notes and documentation, we suspect that option a) might be considered a best practice. We would like to hear your opinions on this matter. Some background information on our historical decisions and current structure:
We would greatly appreciate your insights and recommendations on this matter. Specifically, we would like to know what the recommended best practice is for "new Eclipse plugins + tests" and which approach (a) or (b) you would recommend for our existing code, taking into account the background information provided (the pro's and con's for each variante would help with our decision). Thank you in advance for your support. Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@AhmetBilgin you are right that option It is also common in such setup to still have one (or a few) dedicated Integration test plugins (not fragments(!)) that are testing a larger story with many bundles involved that should work together. For migration, I would pick one test and one bundle and just setup things, look how it works for you and then proceed with moving more stuff there, and if you see any issues please let us know as we want to improve this story see also relevant PDE isses/changes here: |
Beta Was this translation helpful? Give feedback.
@AhmetBilgin you are right that option
a)
is recommended (I don't want to say best-practise as requirements may vary) especially if you don't need "Eclipse" and have own runners and have real Unit-Tests that are dedicated to the code in your plugin. This can be "plain" unit tests, or it could be a plugin test or even a quite new bnd-test...It is also common in such setup to still have one (or a few) dedicated Integration test plugins (not fragments(!)) that are testing a larger story with many bundles involved that should work together.
For migration, I would pick one test and one bundle and just setup things, look how it works for you and then proceed with moving more stuff there, and i…