| Summary: | Automatically add Declarative Service support to test execution | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Tobias Oberlies <t-oberlies> |
| Component: | Tycho | Assignee: | Project Inbox <tycho-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | igor, jan.sievers |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Tobias Oberlies
I am -1 on unconditionally adding org.eclipse.equinox.ds to test runtime. I am +0 on making this optional behaviour, even if it is "on" by default. I wouldn't add a magic dependency to org.eclipse.equinox.ds . You want control over your test runtime and always adding this dependency can lead to unexpected effects. Also, removing the hardcoded dependency is then no longer possible. I would rather see this as an FAQ. I added https://docs.sonatype.org/display/TYCHO/FAQ#FAQ-Q.HowtotestOSGideclarativeservices%3F It is kind of obvious that you need DS if you are testing your own declared services. The more likely case is however that your tests are just using something transitively that uses a declaratively registered service. Wit the ds bundle missing, you get error messages about missing services, but nothing pointing to the root cause. Tycho should make it easy for most users - most users are not bothered by a ds bundle - but also a) provide documentation and debug output to describe what it does automatically (the "convention") and b) provide a switch to disable the automatism. The most important argument for me is still that it works out of the box in Eclipse, and should be just as easy in Tycho. I believe mojo configuration parameter, which is on by default, is a reasonable compromise. Or we can detect use of DS by checking for Service-Component manifest attribute in all bundles present in the target platform. In either case I believe it is important to provide a way to disable automatic injection DS implementation into target runtime. Just to let you know: I have changed my mind about this request, and since I was the only one who liked it in the first place, I'm closing the request as WONTFIX. With Tycho 0.13.0, the test runtime only consists of bundles which are explicitly required. If there are implicit dependencies (like an implicit dependency to DS), the test will fail. This is good, because in an installation of the bundle, the bundle may also not work if the implicit dependencies are not there. This new behaviour forces you to make implicit dependencies explicit. The recommendation is to do this in the feature which is used to ship the bundle, and add that bundle to the test runtime [1]. Then, both the test will run and all installations which include the feature will be valid. [1] http://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-test-plugin |