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

Bug 365090

Summary: Can't run tests in multi-environment build
Product: z_Archived Reporter: Igor Fedorenko <igor>
Component: TychoAssignee: Project Inbox <tycho-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: mistria, xcoulon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
sample project that demostrates the problem none

Description Igor Fedorenko CLA 2011-11-29 11:23:39 EST
Created attachment 207661 [details]
sample project that demostrates the problem

tycho-surefire-plugin calculates test runtime for all os/ws/arch listed under <environments/> in target-platform-configuration. 

In most cases tests can only run against build system's os/ws/arch. Resolving for other os/ws/arch is inefficient and, more importantly, causes resolution failures for environment specific test-only dependencies listed under tycho-surefire-plugin <dependencies/> configuration parameter. See attached sample project.
Comment 1 Mickael Istria CLA 2012-11-08 12:49:52 EST
Any piece of news or suggested workaround for this issue?
The use case is that we want to put
org.eclipse.jdt.launching.macosx;resolution:=optional
in our test bundles so they would work on macosx.

Some ideas:
* Is it possible to make p2 install UI independently of OS/WS/Arch? It's not a problem if this optional bundle is part of the runtime. The OSGi platform simply won't start it.
* Should resolution occur against the current OS/WS/Arch only?
Comment 2 Tobias Oberlies CLA 2012-11-09 10:09:26 EST
IMHO, bug 356582 would be the solution here: This would require to make the additional assumption that all platforms could be installed at once (if they didn't have the platform filters), but I think that this is true in most real-world examples.

The problem is that bug 356582 probably requires changes in the heart of p2 (the projector), and I'm not sure if this will happen any time soon.
Comment 3 Igor Fedorenko CLA 2012-11-09 10:11:10 EST
why not allow test-specific environment configuration? default to the current platform, but allow override in pom.xml.
Comment 4 Mickael Istria CLA 2012-11-09 10:16:23 EST
Yes, I'll try this workaround (overriding target-platform-configuration in a osx-specific profile).
Comment 5 Mickael Istria CLA 2020-06-29 08:56:00 EDT
Bundles that are platform-specific should override the environments defined in target-platform-configuration to avoid extra work against incompatible environments.