Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364145

Summary: test failures due to missing optional bundles
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, dj.houghton, kim.moir, remy.suen, tjwatson
Version: 3.8   
Target Milestone: 3.8 M4   
Hardware: All   
OS: All   
URL: http://download.eclipse.org/eclipse/downloads/drops/N20111117-2000/testresults/html/org.eclipse.ui.tests_linux.gtk.x86_6.0.html
Whiteboard:

Description Dani Megert CLA 2011-11-18 07:42:01 EST
N20111117-2000.

Test failures due to missing optional bundles.
Comment 1 Dani Megert CLA 2011-11-18 08:00:56 EST
Kim, Tom, I need some hints here:

In the 'org.eclipse.ui.tests' I changed
org.eclipse.core.tests.harness,
to
org.eclipse.core.tests.harness;resolution:=optional,

I would expect that this should not affect the official tests since 'org.eclipse.core.tests.harness' should be there.

Am I missing something?
Comment 2 Dani Megert CLA 2011-11-18 08:01:04 EST
.
Comment 3 Dani Megert CLA 2011-11-18 08:01:18 EST
.
Comment 4 Dani Megert CLA 2011-11-20 11:30:06 EST
I see two possible source of the problem:

1) The test scripts don't install the optional bundles.
2) OSGi doesn't resolve the optional bundle because there is no explicit
   non-optional require-bundle rule. However, at least in the IDE this
   works just fine.
Comment 5 Dani Megert CLA 2011-11-21 03:31:20 EST
> 2) OSGi doesn't resolve the optional bundle because there is no explicit
>    non-optional require-bundle rule. However, at least in the IDE this
>    works just fine.
This also seems to work outside the IDE (i.e. if I try with my optional test bundle).
Comment 6 Thomas Watson CLA 2011-11-21 08:08:23 EST
Add DJ to the CC list.  I don't think optionality should effect if the bundle is installed for the tests or not.  DJ, do you know how the bundles are provisioned for testing?
Comment 7 Kim Moir CLA 2011-11-21 09:18:15 EST
There is a properties file generated during the build that lists the test bundles and their dependencies - test.properties.  I don't think it includes optional bundles. For instance, some of the p2 tests require optional dependencies and there is a special clause in the test scripts that install them.

Here are the portion of the test.properties for the ui tests

org.eclipse.ui.tests.rcp=org.eclipse.ui.tests.rcp_3.3.100.N20111120-2000
org.eclipse.ui.tests.rcp.has.performance.target=true
org.eclipse.ui.tests.rcp.prerequisite.testplugins=**/${org.eclipse.ui.tests.harness}**

org.eclipse.ui.tests.views.properties.tabbed=org.eclipse.ui.tests.views.properties.tabbed_3.5.100.N20111120-2000
org.eclipse.ui.tests.views.properties.tabbed.prerequisite.testplugins=

org.eclipse.ui.workbench.texteditor.tests=org.eclipse.ui.workbench.texteditor.tests_3.7.0.N20111120-2000
org.eclipse.ui.workbench.texteditor.tests.has.performance.target=true
org.eclipse.ui.workbench.texteditor.tests.prerequisite.testplugins=**/${org.eclipse.text.tests}**
Comment 8 Dani Megert CLA 2011-11-21 09:29:42 EST
(In reply to comment #7)
> For instance, some of the p2 tests require optional
> dependencies and there is a special clause in the test scripts that install
> them.

Where can I find that (to get a template) and where do I have to add it for the UI test.properties?
Comment 9 Kim Moir CLA 2011-11-21 09:51:59 EST
The test.properties is generated by this Ant task

org.eclipse.releng.basebuilder\plugins\org.eclipse.build.tools\src\org\eclipse\releng\generators\TestVersionTracker.java

If the tests are failing due to missing dependencies, shouldn't the missing bundle be a required bundle of the test bundle?
Comment 10 Dani Megert CLA 2011-11-21 09:56:21 EST
(In reply to comment #9)
> The test.properties is generated by this Ant task
> 
> org.eclipse.releng.basebuilder\plugins\org.eclipse.build.tools\src\org\eclipse\releng\generators\TestVersionTracker.java
> 
> If the tests are failing due to missing dependencies, shouldn't the missing
> bundle be a required bundle of the test bundle?

Yes and no. Most of the UI tests work fine without the core tests. I wanted to be able to run them without being forced to clone the whole core repo. 

I think to exclude optional test bundles doesn't make sense. If you disagree I'm going to remove the "optional" property again.
Comment 11 Dani Megert CLA 2011-11-21 10:10:37 EST
Given my zero knowledge of TestVersionTracker.java and Kim being quite busy I'll just make the core bundles requires as before.
Comment 12 Dani Megert CLA 2011-11-21 10:20:02 EST
Fixed in master: 358a0d44ad042db1cee809e71d8750c38eb15a4c
Fixed in R3_development: 59a65b4515b875d7f3131868332a7769d4861221
Comment 13 Dani Megert CLA 2011-12-06 09:12:42 EST
Verified in I20111205-1800.