Bug 441113 - tycho-surefire can't resolve p2.inf requirements with bundles in same reactor
Summary: tycho-surefire can't resolve p2.inf requirements with bundles in same reactor
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Tobias Oberlies CLA
QA Contact:
URL:
Whiteboard:
Keywords: greatbug
Depends on:
Blocks:
 
Reported: 2014-08-04 16:00 EDT by justin georgeson CLA
Modified: 2021-04-28 16:51 EDT (History)
0 users

See Also:


Attachments
sample projects (22.01 KB, application/x-zip-compressed)
2014-08-04 16:00 EDT, justin georgeson CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description justin georgeson CLA 2014-08-04 16:00:08 EDT
Created attachment 245692 [details]
sample projects

Following up on Bug 433522 (and I apologize for not further testing this next logical step after confirming the fix made in that bug), I'm having trouble with running unit tests with eclipse-test-plugin when a dependency (either Fragment-Host or Require-Bundle) has a p2.inf requirement (in my case one that is provided by a platform fragment bundle). The validate, compile, and package goals are working. But when running the verify goal, if all the projects are in a single reactor, then tycho-surefire fails with unresolved dependencies. If I instead run one maven reactor to insatll host, fragment, and consumer projects and then a second maven reactor to verify the test projects, it works. 

I've updated the sample project from 433522 and added a tests project which is a fragment of the host bundle, a consumer project that depends on the host bundle, and a consumer.tests project which is a fragment of the consumer bundle. 
Running these commands:

    mvn -Dplatform=linux64 package -fae -Ptests
    mvn -Dplatform=linux64 verify -fae -Ptests

The second will show com.lgc.example.host.tests and com.lgc.example.consumer.tests fail like this

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.21.0:test (default-test) on project com.lgc.example.host.tests: Execution default-test of goal org.eclipse.tycho:tycho-surefire-plugin:0.21.0:test failed: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.lgc.example.host 1.0.0.201408041940 to com.lgc.example.linux.gtk.x86_64 [1.0.0.0,1.1.0).; No solution found because the problem is unsatisfiable.] -> [Help 1]
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.21.0:test (default-test) on project com.lgc.example.consumer.tests: Execution default-test of goal org.eclipse.tycho:tycho-surefire-plugin:0.21.0:test failed: No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from com.lgc.example.host 1.0.0.201408041940 to com.lgc.example.linux.gtk.x86_64 [1.0.0.0,1.1.0).; No solution found because the problem is unsatisfiable.] -> [Help 1]
[ERROR] 

Followed with these commands

    mvn -Dplatform=linux64 install
    mvn -Dplatform=linux64 verify -Dreactor=tests

The tests will now succeed.
Comment 1 Tobias Oberlies CLA 2014-08-13 13:49:42 EDT
Thanks for the minimal example project demonstrating the problem. Debugging the problem made me find this tiny but important typo in the code: https://git.eclipse.org/r/#/c/31553/
Comment 2 Tobias Oberlies CLA 2014-08-15 10:47:36 EDT
(In reply to comment #1)
> https://git.eclipse.org/r/#/c/31553/

I've also added an integration test which covers the scenario where a host plug-in ensures that the appropriate fragment is installed. It also includes a consumer, whose resolution fails without the bugfix.
Comment 3 Tobias Oberlies CLA 2014-08-18 06:23:04 EDT
The fix is submitted [1]

@Justin: Thanks again for this very good bug report!


[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=130a8dd40a12998445d99eb689b885016ce27b3d