Discussion:
[tycho-user] Test runtime with platform specific fragments
Greg Amerson
2014-01-02 06:07:58 UTC
Permalink
Hey everyone,

I'm using tycho to build and test some eclipse plugins. I have one bundle
that has many platform specific fragments. I also have one test bundle that
is using tycho-surefire-plugin to test the original bundle that has the
platform specific fragments. However, tycho is not including the current
platform's fragment into the test runtime.

All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.

Example win64 Fragment pom.xml's section

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>

When I try to execute my tycho build and it runs the surefire test plugin
(no matter which OS I try), the correct platform fragment is not added into
the runtime.

Any ideas?

I've seen various posts on stackoverflow about similar questions but in
those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.

I've attached an example multi-module project the demonstrates the problem.

After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Tonny Madsen
2014-01-02 13:03:07 UTC
Permalink
Greg,

There are an outstanding issue open on this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution in the
works as well (https://git.eclipse.org/r/#/c/17296/)... Though I have no
ideas when this will be included in a Tycho release :-)

For now I use the following construct to force the fragment in my test. You
can add similar profiles for other architecture - though the activation can
be a little tricky. If you have many different tests where this is needed,
then you are in for some boring work!

/Tonny

<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>


--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen> [image:
Twitter] <http://twitter.com/tonnymadsen> [image:
Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Greg Amerson
Hey everyone,
I'm using tycho to build and test some eclipse plugins. I have one bundle
that has many platform specific fragments. I also have one test bundle that
is using tycho-surefire-plugin to test the original bundle that has the
platform specific fragments. However, tycho is not including the current
platform's fragment into the test runtime.
All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws
=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
Example win64 Fragment pom.xml's section
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to execute my tycho build and it runs the surefire test plugin
(no matter which OS I try), the correct platform fragment is not added into
the runtime.
Any ideas?
I've seen various posts on stackoverflow about similar questions but in
those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.
I've attached an example multi-module project the demonstrates the problem.
After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Greg Amerson
2014-01-03 02:11:18 UTC
Permalink
Thanks Tonny for the detailed explanation. However, I tried your solution
but in my case the extra requirement that I'm trying to add in the
dependency-resolution is a actually one of the bundles that my maven
project builds. So there is no fragment it can install into the test
runtime, but rather, it needs to get the fragment from the current maven
reactor that is being built. Any way around this?
Post by Tonny Madsen
Greg,
There are an outstanding issue open on this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution in
the works as well (https://git.eclipse.org/r/#/c/17296/)... Though I have
no ideas when this will be included in a Tycho release :-)
For now I use the following construct to force the fragment in my test.
You can add similar profiles for other architecture - though the activation
can be a little tricky. If you have many different tests where this is
needed, then you are in for some boring work!
/Tonny
<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Greg Amerson
Hey everyone,
I'm using tycho to build and test some eclipse plugins. I have one bundle
that has many platform specific fragments. I also have one test bundle that
is using tycho-surefire-plugin to test the original bundle that has the
platform specific fragments. However, tycho is not including the current
platform's fragment into the test runtime.
All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws
=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
Example win64 Fragment pom.xml's section
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to execute my tycho build and it runs the surefire test plugin
(no matter which OS I try), the correct platform fragment is not added into
the runtime.
Any ideas?
I've seen various posts on stackoverflow about similar questions but in
those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.
I've attached an example multi-module project the demonstrates the problem.
After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Tonny Madsen
2014-01-03 06:45:27 UTC
Permalink
Greg, I haven't tried that, but I would have thought it should work
directly - though you might need an extra dependency at the pom level as I
don't think the extraRequirements are considered in the reactor ordering.
I'll test it later today... /Tonny

--
Tonny Madsen
(sent from my mobile device)
Post by Greg Amerson
Thanks Tonny for the detailed explanation. However, I tried your solution
but in my case the extra requirement that I'm trying to add in the
dependency-resolution is a actually one of the bundles that my maven
project builds. So there is no fragment it can install into the test
runtime, but rather, it needs to get the fragment from the current maven
reactor that is being built. Any way around this?
Post by Tonny Madsen
Greg,
There are an outstanding issue open on this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution in
the works as well (https://git.eclipse.org/r/#/c/17296/)... Though I
have no ideas when this will be included in a Tycho release :-)
For now I use the following construct to force the fragment in my test.
You can add similar profiles for other architecture - though the activation
can be a little tricky. If you have many different tests where this is
needed, then you are in for some boring work!
/Tonny
<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Greg Amerson
Hey everyone,
I'm using tycho to build and test some eclipse plugins. I have one
bundle that has many platform specific fragments. I also have one test
bundle that is using tycho-surefire-plugin to test the original bundle that
has the platform specific fragments. However, tycho is not including the
current platform's fragment into the test runtime.
All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws
=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
Example win64 Fragment pom.xml's section
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to execute my tycho build and it runs the surefire test
plugin (no matter which OS I try), the correct platform fragment is not
added into the runtime.
Any ideas?
I've seen various posts on stackoverflow about similar questions but in
those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.
I've attached an example multi-module project the demonstrates the problem.
After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Tonny Madsen
2014-01-03 09:09:19 UTC
Permalink
Greg, It works for me directly. And extraRequirements are used in the
reactor ordering. /Tonny

--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen> [image:
Twitter] <http://twitter.com/tonnymadsen> [image:
Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Tonny Madsen
Greg, I haven't tried that, but I would have thought it should work
directly - though you might need an extra dependency at the pom level as I
don't think the extraRequirements are considered in the reactor ordering.
I'll test it later today... /Tonny
--
Tonny Madsen
(sent from my mobile device)
Post by Greg Amerson
Thanks Tonny for the detailed explanation. However, I tried your
solution but in my case the extra requirement that I'm trying to add in the
dependency-resolution is a actually one of the bundles that my maven
project builds. So there is no fragment it can install into the test
runtime, but rather, it needs to get the fragment from the current maven
reactor that is being built. Any way around this?
Post by Tonny Madsen
Greg,
There are an outstanding issue open on this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution in
the works as well (https://git.eclipse.org/r/#/c/17296/)... Though I
have no ideas when this will be included in a Tycho release :-)
For now I use the following construct to force the fragment in my test.
You can add similar profiles for other architecture - though the activation
can be a little tricky. If you have many different tests where this is
needed, then you are in for some boring work!
/Tonny
<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
On Thu, Jan 2, 2014 at 7:07 AM, Greg Amerson <
Post by Greg Amerson
Hey everyone,
I'm using tycho to build and test some eclipse plugins. I have one
bundle that has many platform specific fragments. I also have one test
bundle that is using tycho-surefire-plugin to test the original bundle that
has the platform specific fragments. However, tycho is not including the
current platform's fragment into the test runtime.
All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
Bundle-SymbolicName: com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws
=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
Example win64 Fragment pom.xml's section
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to execute my tycho build and it runs the surefire test
plugin (no matter which OS I try), the correct platform fragment is not
added into the runtime.
Any ideas?
I've seen various posts on stackoverflow about similar questions but in
those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.
I've attached an example multi-module project the demonstrates the problem.
After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Greg Amerson
2014-01-03 09:22:59 UTC
Permalink
Hey Tonny,

Can you try to see if it works with the attached test project? For me it
doesn't work, the unit test fails because it can't find the files in the
fragments (will only work with either win64 or linux64). Let me know if
you have mac.

When I run 'mvn clean verify' I get the attached error log.
Post by Tonny Madsen
Greg, It works for me directly. And extraRequirements are used in the
reactor ordering. /Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Tonny Madsen
Greg, I haven't tried that, but I would have thought it should work
directly - though you might need an extra dependency at the pom level as I
don't think the extraRequirements are considered in the reactor ordering.
I'll test it later today... /Tonny
--
Tonny Madsen
(sent from my mobile device)
Post by Greg Amerson
Thanks Tonny for the detailed explanation. However, I tried your
solution but in my case the extra requirement that I'm trying to add in the
dependency-resolution is a actually one of the bundles that my maven
project builds. So there is no fragment it can install into the test
runtime, but rather, it needs to get the fragment from the current maven
reactor that is being built. Any way around this?
Post by Tonny Madsen
Greg,
There are an outstanding issue open on this (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636) and a solution
in the works as well (https://git.eclipse.org/r/#/c/17296/)... Though
I have no ideas when this will be included in a Tycho release :-)
For now I use the following construct to force the fragment in my test.
You can add similar profiles for other architecture - though the activation
can be a little tricky. If you have many different tests where this is
needed, then you are in for some boring work!
/Tonny
<profiles>
<profile>
<id>test-on-mac</id>
<activation>
<os>
<family>mac</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho.version}</version>
<configuration>
<dependency-resolution>
<optionalDependencies>ignore</optionalDependencies>
<extraRequirements combine.children="append">
<requirement>
<type>eclipse-plugin</type>
<id>org.eclipse.jdt.launching.macosx</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen>
[image: Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
On Thu, Jan 2, 2014 at 7:07 AM, Greg Amerson <
Post by Greg Amerson
Hey everyone,
I'm using tycho to build and test some eclipse plugins. I have one
bundle that has many platform specific fragments. I also have one test
bundle that is using tycho-surefire-plugin to test the original bundle that
has the platform specific fragments. However, tycho is not including the
current platform's fragment into the test runtime.
All of the platform specific fragments look like the win64 fragment
manifest listed below (there are actually 6 total fragments, one for each
platform combination I need to support.)
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Liferay AUI Upgrade Tool Win64
com.liferay.laut.win32.win32.x86_64;singleton:=true
Bundle-Version: 1.0.2.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Fragment-Host: com.liferay.ide.alloy.core
Eclipse-BundleShape: dir
Eclipse-PlatformFilter: (& (osgi.ws
=win32)(osgi.os=win32)(osgi.arch=x86_64))
Bundle-Vendor: Liferay, Inc.
Example win64 Fragment pom.xml's section
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
When I try to execute my tycho build and it runs the surefire test
plugin (no matter which OS I try), the correct platform fragment is not
added into the runtime.
Any ideas?
I've seen various posts on stackoverflow about similar questions but
in those cases the fragments loaded into the test runtime were not
platform-specific fragments with OS filters.
I've attached an example multi-module project the demonstrates the problem.
After you run the test if you look at the bundles that are started by
surefire it doesn't include the example.bundle.win32.win32.x86_64 fragment
if you are on windows or the example.bundle.linux.gtk.x86_64 fragment if
you are on linux.
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Mickael Istria
2014-01-03 11:38:53 UTC
Permalink
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal
with multiple environments, you'll probably need to spend a hundred
lines in your pom.xml to set up profiles. See related scenario:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
Greg Amerson
2014-01-03 14:36:16 UTC
Permalink
I tried setting up an explicit dependency to my win32 fragment since I'm
trying to run the tests on windows. But it fails with these errors:

ERROR] Cannot resolve project dependencies:
ERROR] You requested to install 'bundle
example.fragment.win32.win32.x86_64 0.0.0' but it could not be found
ERROR]

[ERROR] Failed to execute goal
org.eclipse.tycho:tycho-surefire-plugin:0.19.0:test (default-test) on
project example.bundle.t
ests: Execution default-test of goal
org.eclipse.tycho:tycho-surefire-plugin:0.19.0:test failed: No solution
found because th
e problem is unsatisfiable.: [Unable to satisfy dependency from
org.eclipse.jdt.core 3.9.0.v_OTDT_r220_201306071800 to org.ec
lipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).; Unable to
satisfy dependency from org.eclipse.jdt.core 3.9.1.
v_OTDT_r221_201309101918 to
org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).;
Unable to satisfy dependenc
y from tycho-extra-1388759312067 0.0.0.1388759312067 to bundle
example.fragment.win32.win32.x86_64 0.0.0.; Unable to satisfy
dependency from tycho-1388759312099 0.0.0.1388759312099 to bundle
example.fragment.win32.win32.x86_64 0.0.0.; No solution fou
nd because the problem is unsatisfiable.] -> [Help 1]
[ERROR]


It seems that since example.fragment.win32.win32.x86_64 fragment can't be
installed which I guess makes sense because that fragment is being built
and is in the reactor but not in local repository.
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Mickael Istria
2014-01-03 14:47:57 UTC
Permalink
Post by Greg Amerson
I tried setting up an explicit dependency to my win32 fragment since
How did you set it up? Did you use
http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#dependencies
in tycho-surefire-plugin configuration?

<dependencies>
<dependency>
<type>p2-installable-unit</type>
<artifactId>example.fragment.win32.win32.x86_64</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>

should be able to resolve against current reactor. Did you also make
sure that the fragment is listed in the parent pom BEFORE the test
plugins (IIRC extra dependencies for surefire are still not part of the
initial dependency resolution so you need to ensure dependencies have
been processed at the time surefire starts).--
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets
<http://twitter.com/mickaelistria>
Greg Amerson
2014-01-03 14:58:15 UTC
Permalink
I've tried both ways...

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<dependency-resolution>
<extraRequirements>
<requirement>
<dependency>
<type>p2-installable-unit</type>
<artifactId>example.fragment.win32.win32.x86_64</artifactId>
<version>0.0.0</version>
<optional>true</optional>
</dependency>
</requirement>
</extraRequirements>
</dependency-resolution>
</configuration>
</plugin>

and then also

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<configuration>
<dependencies>
<dependency>
<type>p2-installable-unit</type>
<artifactId>example.fragment.win32.win32.x86_64</artifactId>
<version>0.0.0</version>
<optional>true</optional>
</dependency>
</dependencies>
</configuration>
</plugin>


Both don't work. And also in the maven reactor it looks like this, so it
does seem the fragments have been built previous to the test.

-------------------------------------------------------
Running example.bundle.tests.ExampleBundleTests
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.025 sec
<<< FAILURE!

Results :

Tests in error:
testFragments(example.bundle.tests.ExampleBundleTests)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Tycho Test Runtime ................................ SUCCESS [0.061s]
[INFO] Example Bundle .................................... SUCCESS [1.234s]
[INFO] Example Fragment Linux64 .......................... SUCCESS [0.109s]
[INFO] Example Fragment Windows 64bit .................... SUCCESS [0.103s]
[INFO] Example Feature ................................... SUCCESS [0.068s]
[INFO] Example Bundle Tests .............................. FAILURE [4.146s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 22.471s
Post by Greg Amerson
I tried setting up an explicit dependency to my win32 fragment since I'm
How did you set it up? Did you use
http://www.eclipse.org/tycho/sitedocs/tycho-surefire/tycho-surefire-plugin/test-mojo.html#dependenciesin tycho-surefire-plugin configuration?
<dependencies>
<dependency>
<type>p2-installable-unit</type>
<artifactId>example.fragment.win32.win32.x86_64</artifactId>
<version>0.0.0</version>
</dependency>
</dependencies>
should be able to resolve against current reactor. Did you also make sure
that the fragment is listed in the parent pom BEFORE the test plugins (IIRC
extra dependencies for surefire are still not part of the initial
dependency resolution so you need to ensure dependencies have been
processed at the time surefire starts).--
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Tonny Madsen
2014-01-03 18:50:35 UTC
Permalink
The problem with extraDependencies is that it is *NOT* considered in the
reactor reordering! And if you want to have a dependency on another
bundle/module from the reactor, then this can be a serious problem - see
http://tonnymadsen.blogspot.dk/2013/04/tycho-test-trouble-expectations-and.html

/Tonny

--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen> [image:
Twitter] <http://twitter.com/tonnymadsen> [image:
Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Greg Amerson
2014-01-06 09:35:59 UTC
Permalink
So it appears that as of right now there is no workaround for my setup
since I need to add a dependency on another bundle/module in the current
reactor?
Post by Tonny Madsen
The problem with extraDependencies is that it is *NOT* considered in the
reactor reordering! And if you want to have a dependency on another
bundle/module from the reactor, then this can be a serious problem - see
http://tonnymadsen.blogspot.dk/2013/04/tycho-test-trouble-expectations-and.html
/Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Tonny Madsen
2014-01-06 10:32:47 UTC
Permalink
Greg,

<extraRequirements combine.children="append"> - as used in my first answer
- works fine for me with local (in the reactor) modules. And it influence
the reactor build order correctly ;-)

/Tonny

--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen> [image:
Twitter] <http://twitter.com/tonnymadsen> [image:
Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>


On Mon, Jan 6, 2014 at 10:35 AM, Greg Amerson
Post by Greg Amerson
So it appears that as of right now there is no workaround for my setup
since I need to add a dependency on another bundle/module in the current
reactor?
Post by Tonny Madsen
The problem with extraDependencies is that it is *NOT* considered in the
reactor reordering! And if you want to have a dependency on another
bundle/module from the reactor, then this can be a serious problem - see
http://tonnymadsen.blogspot.dk/2013/04/tycho-test-trouble-expectations-and.html
/Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
Greg Amerson
2014-01-06 13:11:24 UTC
Permalink
Hey Tonny,

I really appreciate your help with this, thanks for taking the time to
respond. However, I tried your suggestion but in my stand-alone example I
still can't get the tests to run. I've attached the project if you want to
take a look. Here is the example error that I get:

[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86,
org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] You requested to install 'bundle
example.fragment.win32.win32.x86_64 0.0.0' but it could not be found
[ERROR]

It seems that when the osgi.arch is x86, its activating the extra
dependencies. Not for sure why.
Post by Tonny Madsen
Greg,
<extraRequirements combine.children="append"> - as used in my first answer
- works fine for me with local (in the reactor) modules. And it influence
the reactor build order correctly ;-)
/Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Greg Amerson
So it appears that as of right now there is no workaround for my setup
since I need to add a dependency on another bundle/module in the current
reactor?
Post by Tonny Madsen
The problem with extraDependencies is that it is *NOT* considered in the
reactor reordering! And if you want to have a dependency on another
bundle/module from the reactor, then this can be a serious problem - see
http://tonnymadsen.blogspot.dk/2013/04/tycho-test-trouble-expectations-and.html
/Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
Post by Greg Amerson
Post by Tonny Madsen
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Greg Amerson
2014-01-07 15:27:33 UTC
Permalink
Hey everyone,

Just so there is some closure, I got everything working with both Tonny and
Tobias's help. I was just needed to switch one tycho-surefire-plugin with
a target-platform-configuration and things are all working now.

https://github.com/gamerson/liferay-ide-sandbox/tree/master/tycho-test-runtime

Thanks again everyone.
Post by Greg Amerson
Hey Tonny,
I really appreciate your help with this, thanks for taking the time to
respond. However, I tried your suggestion but in my stand-alone example I
still can't get the tests to run. I've attached the project if you want to
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86,
org.eclipse.update.install.features=true}
[ERROR] You requested to install 'bundle
example.fragment.win32.win32.x86_64 0.0.0' but it could not be found
[ERROR]
It seems that when the osgi.arch is x86, its activating the extra
dependencies. Not for sure why.
Post by Tonny Madsen
Greg,
<extraRequirements combine.children="append"> - as used in my first
answer - works fine for me with local (in the reactor) modules. And it
influence the reactor build order correctly ;-)
/Tonny
--
Tonny Madsen
Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
On Mon, Jan 6, 2014 at 10:35 AM, Greg Amerson <
Post by Greg Amerson
So it appears that as of right now there is no workaround for my setup
since I need to add a dependency on another bundle/module in the current
reactor?
Post by Tonny Madsen
The problem with extraDependencies is that it is *NOT* considered in
the reactor reordering! And if you want to have a dependency on another
bundle/module from the reactor, then this can be a serious problem - see
http://tonnymadsen.blogspot.dk/2013/04/tycho-test-trouble-expectations-and.html
/Tonny
--
Tonny Madsen
My profiles: [image: LinkedIn] <http://www.linkedin.com/in/tonnymadsen>
[image: Twitter] <http://twitter.com/tonnymadsen> [image: Blogger]<http://tonnymadsen.blogspot.dk/>
[image: SlideShare] <http://www.slideshare.net/nonty>
Post by Mickael Istria
You should try to explicitly add the fragment as an extraDependency.
It seems to me that because of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394636 , transitive
platform-specific dependencies almost always get ignored. If you deal with
multiple environments, you'll probably need to spend a hundred lines in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419147 .
--
Mickael Istria
Eclipse developer at JBoss, by Red Hat <http://www.jboss.org/tools>
My blog <http://mickaelistria.wordpress.com> - My Tweets<http://twitter.com/mickaelistria>
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
Post by Greg Amerson
Post by Tonny Madsen
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
--
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
Loading...