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

Bug 367982

Summary: Test failures in nightly build
Product: [Eclipse Project] PDE Reporter: DJ Houghton <dj.houghton>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, daniel_megert, tjwatson
Version: 3.8   
Target Milestone: 3.8 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
work in progress none

Description DJ Houghton CLA 2012-01-05 15:16:43 EST
There are some test failures in last night's nightly build. Tom is concerned they might be related to the changes in bug 366419.

One of the tests which is failing is PublishingTests.testBug277824. When running this, it appears the metadata generated is missing information. 

I ran the tests against the old version of OSGi (tests pass) and the new version (tests fail). In the second run, the metadata for the "foo" IU is missing the following required entries:

<required namespace='org.eclipse.equinox.p2.iu' name='foo.root.feature.feature.group' range='[1.0.0.v1234,1.0.0.v1234]'/>

<required namespace='org.eclipse.equinox.p2.iu' name='toolingorg.eclipse.equinox.common' range='[1.0.0.v1234,1.0.0.v1234]'/>

<required namespace='org.eclipse.equinox.p2.iu' name='toolingorg.eclipse.osgi' range='[1.0.0.v1234,1.0.0.v1234]'/>
Comment 1 Andrew Niefer CLA 2012-01-05 17:09:01 EST
The new osgi VersionRange#toString can print something like "[1.0.0-,2.0.0-)".

In pde.build's P2InfUtils we are generating a p2.inf file for p2.  There are several places here where we use VersionRange.toString().

p2 has its own org.eclipse.equinox.p2.metadata.VersionRange class which is used when parsing the p2.inf file (from p2.publisher AdviceFileParser).  This class does not understand the new format and throws and exception causing that particular piece of advice to be ignored leading to missing requirements in the result.

A fix on PE/Build's side would be to no use VersionRange.toString and instead print the range ourselves in a format that p2 understands.

In general p2 may have a larger problem if this new format makes its way into feature.xml or .product files.
Comment 2 Thomas Watson CLA 2012-01-05 17:38:53 EST
Created attachment 209111 [details]
work in progress

Here is a hack until p2 can properly handle fully qualified versions and pre-release versions.

The basic approach is to never call VersionRange.toString().  Instead there is a method added to Utils toString(VersionRange) which never prints fully qualified versions which have empty qualifiers.  Instead it prints them with out the trailing '.' or '-'.

I am not convinced I found all places where VersionRange.toString() was called, but this patch at least let testBug277824 pass for me.
Comment 3 Thomas Watson CLA 2012-01-06 08:46:16 EST
(In reply to comment #1)
> In general p2 may have a larger problem if this new format makes its way into
> feature.xml or .product files.

This is tracked by bug 367991.
Comment 4 DJ Houghton CLA 2012-01-06 14:30:57 EST
Patch released. Thanks Tom. I've verified that we've caught all toString callers in PDE/Build but we will still need to fix things in p2 (bug 367991).

http://git.eclipse.org/c/pde/eclipse.pde.build.git/commit/?id=67b2ea6074c2a2bc6701e678c843b3adf688fc24
Comment 5 Dani Megert CLA 2012-01-10 06:55:46 EST
I'm reopening this one as the fix did not get rid of all test failures. Since N20120105-2000 'testBug268498' constantly fails (and also failed in N20120104-2000).

http://download.eclipse.org/eclipse/downloads/drops/N20120105-2000/testresults/html/org.eclipse.pde.build.tests_linux.gtk.x86_6.0.html
Comment 6 Dani Megert CLA 2012-01-10 06:55:55 EST
.
Comment 7 Thomas Watson CLA 2012-01-10 08:45:14 EST
(In reply to comment #5)
> I'm reopening this one as the fix did not get rid of all test failures. Since
> N20120105-2000 'testBug268498' constantly fails (and also failed in
> N20120104-2000).
> 
> http://download.eclipse.org/eclipse/downloads/drops/N20120105-2000/testresults/html/org.eclipse.pde.build.tests_linux.gtk.x86_6.0.html

This test also failed in the I20120103-0800 build which was before the VersionRange changes for pre-release support bug 366419.  So it appears this failure is unrelated to the VersionRange changes.
Comment 8 Dani Megert CLA 2012-01-10 08:52:12 EST
> This test also failed in the I20120103-0800 build which was before the
> VersionRange changes for pre-release support bug 366419.  So it appears this
> failure is unrelated to the VersionRange changes.

OK. File bug 368246.
Comment 9 Thomas Watson CLA 2012-01-19 14:34:55 EST
Note that I opened bug369140 to revert this fix.