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

Bug 327466

Summary: Investigate why the kernel-tools repository fails to build with clover in target list
Product: [RT] Virgo Reporter: Steve Powell <zteve.powell>
Component: unknownAssignee: Glyn Normington <glyn.normington>
Status: CLOSED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: b.kapukaranov, eclipse, glyn.normington
Version: unspecified   
Target Milestone: 3.0.0.M05   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Steve Powell CLA 2010-10-11 12:07:25 EDT
When putting clover in the target list

e.g.

ant test clover

the build fails when running the clover-woven tests with a resolve errors:

clover.do:
    [mkdir] Created dir: /Users/spowell/dev/virgo/kernel-tools/org.eclipse.virgo.kernel.tools/target/test-results/xml
    [junit] Testsuite: org.eclipse.virgo.kernel.osgi.provisioning.tools.test.DependencyLocatorTests
    [junit] Tests run: 0, Failures: 0, Errors: 1, Time elapsed: 0.751 sec
    [junit] 
    [junit] ------------- Standard Output ---------------
    [junit] Listening on port 2401 ... 
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: org.eclipse.virgo.kernel.osgi.provisioning.tools.test.DependencyLocatorTests:	Caused an ERROR
    [junit] Bundle org.eclipse.virgo.kernel.tools 2.0.0 failed to start.
    [junit] org.osgi.framework.BundleException: Bundle org.eclipse.virgo.kernel.tools 2.0.0 failed to start.
    [junit] 	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.installAndStartBundles(FrameworkBuilder.java:175)
    [junit] 	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.start(FrameworkBuilder.java:155)
    [junit] 	at org.eclipse.virgo.test.framework.OsgiTestRunner.launchOsgi(OsgiTestRunner.java:129)
    [junit] 	at org.eclipse.virgo.test.framework.OsgiTestRunner.run(OsgiTestRunner.java:68)
    [junit] Caused by: org.osgi.framework.BundleException: The bundle "org.eclipse.virgo.kernel.tools_2.0.0 [13]" could not be resolved. Reason: Missing Constraint: Import-Package: org.eclipse.virgo.medic.eventlog; version="[2.1.0,2.2.0)"
    [junit] 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
    [junit] 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
    [junit] 	at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)
    [junit] 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
    [junit] 	at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)
    [junit] 	at org.eclipse.virgo.osgi.launcher.FrameworkBuilder.installAndStartBundles(FrameworkBuilder.java:173)

This may be due to the fact that there are no actual unit tests in the repository/project and/or bundlor appears not to be generating the correct manifest the second time.
Comment 1 Borislav Kapukaranov CLA 2011-01-28 08:07:38 EST
It seems the bug is no longer reproducible on Windows and Mac OS. I'm closing the bug.
Comment 2 Steve Powell CLA 2011-02-03 06:07:08 EST
(In reply to comment #1)
I can reproduce it.  Fails reliably for me on MacOS.  Now what?

Please can you show what you did to try to recreate the problem?
Comment 3 Borislav Kapukaranov CLA 2011-02-03 06:16:41 EST
(In reply to comment #2)
> (In reply to comment #1)
> I can reproduce it.  Fails reliably for me on MacOS.  Now what?
> 
> Please can you show what you did to try to recreate the problem?

What i did is to clone the repo and execute "ant clean clean-integration test clover" on it. It passed. Then i executed "and test clover" - again passed. Chris Frost also executed the first step on his Mac OS X machine, because i suspected it might be a Mac only issue - it again passed without a glitch. I don't know if he tried the second step.

Please can you share some exact steps that you use to reproduce it, because obviously from what is reported here it isn't clear enough.
Comment 4 Steve Powell CLA 2011-02-03 06:34:03 EST
(In reply to comment #3)
Ah -- you didn't say clean-ivy, so you probably have old dependencies lying around.  Either delete and clone the repo from scratch and run:

   ant clover

or run:

   ant clean-ivy clean-integration clean clover

to get the results I did.

This behaviour implies it is a dependency typo (look in the ivy files).

[NOTE: in the Hudson server builds we ask for a clean git repo (git clean -fdx) on checkout, which will remove all the ivy and ant debris automatically. Thus it is as though we issue 'ant clean clean-integration clean-ivy' before every server build.  This could explain why it fails on the server.  I long ago got into the habit of running with 'clean-ivy' on my local machine; even though it takes longer to download all the dependencies it checks they are correctly set.]
Comment 5 Chris Frost CLA 2011-02-04 12:25:07 EST
It fails because the javac command run by clover only copies over 18 files to 'target/classes' when this build step run under a normal run of the tests 21 files get copied. Looking at the error clover fails with I assume one of the files not copied is 'META-INF/MANIFEST.MF'.
Comment 6 Borislav Kapukaranov CLA 2011-02-17 05:12:18 EST
Even executing with "ant clean-ivy clean-integration clean clover" several times in a row didn't help to reproduce this on Windows. I also saw the manifests are correctly copied over to target/classes. So no luck with that one... I guess one of you guys with Mac OS should take this one.
Comment 7 Glyn Normington CLA 2011-02-17 05:20:06 EST
Fair enough. Thanks.
Comment 8 Chris Frost CLA 2011-02-17 05:24:43 EST
I've just re-run on Mac and it still fails as described. A Mac specific Bundlor bug, interesting.
Comment 9 Glyn Normington CLA 2011-04-27 06:11:10 EDT
The problem is that kernel tools does not have any unit tests but the build was set so that the integration tests were being run through clover when clover was specified as a build target. Since clover is not set to generate manifests, since it is only intended to be used for unit tests, the manifest was MIA and caused the failure.

The solution was to provide an empty list of unit test bundles, which causes a slightly cleaner failure because there is no clover data to process and then to override the clover target and fail the build with a message, e.g.
$ ant clean clean-integration clover
Buildfile: build.xml

clean:
   [delete] Deleting directory /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/build-kernel-tools/target
   [subant] Entering directory: /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/org.eclipse.virgo.kernel.tools

clean:
   [delete] Deleting directory /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/org.eclipse.virgo.kernel.tools/target
   [subant] Leaving directory: /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/org.eclipse.virgo.kernel.tools

clean-integration:
   [delete] Deleting directory /Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/integration-repo

clover:

BUILD FAILED
/Users/glynnormington/eclipse/virgo/org.eclipse.virgo.kernel-tools/build-kernel-tools/build.xml:20: kernel tools has no unit tests, so Clover is not applicable

Total time: 0 seconds