Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Problem with surefire tests & exploded bundle

Hello,


2013/6/1 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
My suggestion:

build a sample project based on plexus archiver api and try to reproduce the issue. Then, fill the JIRA will a link to the project (Github hosted).

I'll do that.
 
For your project, I think there may be a workaround.
Instead of unpacking you dependencies into the lib folder, just copy the JAR in lib and update the bundle classpath (I don't think you can specify lib/*.jar) with each jar. Make sure that when you copy the dependecies in the lib folder, the version suffix is stripped so that you don't need to update the bundle manifest if you change the version of a dependency. With this, you will need to update your bundle manifest only when you add or remove a dependency.

Comments ?

That's exactly what I did, and now the test preparation is OK. There's indeed the little annoyance of having to take care of declaring dependencies in the MANIFEST, but that's not a big deal and will do until plexus archiver is (hopefully) fixed.

I now have some other problems, which may be related to assumptions in code about the new layout of the lib/ directory, but that I can take care of :-)

Thanks for the guidance and moral support,

-- 
Laurent

 

Jeff


On Sat, Jun 1, 2013 at 12:37 AM, Laurent PETIT <laurent.petit@xxxxxxxxx> wrote:
OK, so the JIRA for plexus archiver has an unresolved issue almost similar to mine ( but talking about problems with dollars in file names, not folder names ) : http://jira.codehaus.org/browse/PLXCOMP-164

The last comment to date informed that upgrading maven-dependency-plugin to be of version 2.4 solved the problem somehow.

Glad that the issue was not closed, or I would have missed the trick.

Unfortunately, the issue may have been solved for file names with dollars, but not for directories.

I've updated the test github repo to explicitly use maven-dependency-plugin 2.8, btw.


What do you suggest my next move be?
I don't want to just throw a bug to the JIRA and desparately wait for things to move. What would be the most efficient ?



2013/6/1 Laurent PETIT <laurent.petit@xxxxxxxxx>
Progress report :

Thanks to Jeff, the error was more precisely identified: 

- when a bundle is meant to be unpacked when installed
- on a Linux or BSD (OS X) machine
- during the preparation phase of the integration tests

... then if the bundle had at least one bundled package whose name contains the dollar sign ( such as in lib/foo$bar/baz.class ), there will be a chmod error and the tests will fail without ever having had a chance to pass.

Note that this problem seems related to the use of the plexus archiver. That's why the problem does not occur when installing the bundle "normally" via the p2 tools (eg during a normal Eclipse plugin install)

I've created a minimalistic repository for you to easily reproduce the problem: https://github.com/laurentpetit/tycho-dollar-issue 

Instructions are on the README.md


I will check the plexus archiver JIRA to see if I can spot an existing open bug related to my issue.

In the mean time, you can easily reproduce the issue with the minimalistic github project mentioned above.

Cheers,

-- 
Laurent









2013/5/30 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
Laurent,

I tested on my Windows7 box and I add test errors but not the same as yours. At least tests are executed. Will try this evening on my MacOS box.

Regards
Jeff



On Thu, May 30, 2013 at 5:50 PM, Laurent PETIT <laurent.petit@xxxxxxxxx> wrote:
Hello,


2013/5/28 Jeff MAURY <jeffmaury@xxxxxxxxxxxxx>
Hello,

I have the same constraint in one of my plugins. I use only the Eclipse-BundleShape directive.
I had no problems but I have to check if one of my tests is using this feature.


I don't know if you were able to check. On my side, as reported in my response to Jan, there hasn't been much progress, despite having devoted a lot of time to this issue :-(

Without any guidance for helping me narrow down the issue (e.g. "chmod exit code = 1" does not help a lot), I wonder what my options are ... :

- it'll be difficult if not impossible to refactor my project to not embed jar contents (exploded in a lib directory via a call to dependency:unpack-dependencies, btw) in my core plugin
- I can try to use dependency:copy-dependencies instead, but it will still require me to do some changes here and there, plus it's less convenient (have to maintain list of jars up to date in my plugin's build.properties and MANIFEST.MF).
- try to install tycho, and the nexus dependency why does the chmod call to add more debug info into it ? (is it hard to do? I fear it is time consuming, but maybe I'm wrong?)

Thanks for any info/guidance,

-- 
Laurent
 
Jeff



On Tue, May 28, 2013 at 8:37 AM, Laurent PETIT <laurent.petit@xxxxxxxxx> wrote:
Nobody encountered this problem before ?

Le dimanche 26 mai 2013, Laurent PETIT a écrit :

Hello,

My project requires that my core bundle be exploded to work.

Unit tests which work from my Development environment neither work
locally via mvn command, neither externally on travis-ci.

I have taken care of doing the following:

- originally (for user deployment time), my feature declares that the
bundle must be unpacked
- I have also added an
<explodedBundles><explodedBundle>ccw.core</explodedBundle></explodedBundles>
sufire configuration to the pom of my tests
- I have also added an Eclipse specific META-INF directive,
"Eclipse-BundleShape: dir", to my core plugin, as suggested somewhere
(in the FAQ I guess ? Or was it on StackOverflow, don't remember).

I have made the last 2 additions incrementally, so I had first tested
without both, then with the <explodedBundles>, then with the MANIFEST
Eclipse specific directive.

on Travis-ci (Ubuntu Server 12.04, the build fails with this root exception:
 "Caused by: org.codehaus.plexus.archiver.ArchiverException: chmod
exit code was: 2"

on my local machine, same chmod issue, but the exit code is 1 instead
of 2 (I have a Mac Book Air with OS X Lion)

link to the failed build on travis:
https://travis-ci.org/laurentpetit/ccw/jobs/7515910#L4268
link to the project on github: https://github.com/laurentpetit/ccw

Any idea ?

Thanks in advance,

--
Laurent

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user




--
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user



Back to the top