Bug 567318 - Cannot run PDE JUnit tests on self-defined target platform
Summary: Cannot run PDE JUnit tests on self-defined target platform
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 4.18 M1   Edit
Assignee: Julian Honnen CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-09-24 06:55 EDT by Alexander Levsha CLA
Modified: 2020-10-07 07:10 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Levsha CLA 2020-09-24 06:55:42 EDT
This seems to be a reoccurrence of bug 128972 or bug 216946.

I have a target platform for my plugins containing Eclipse Platform, JUnit framework, and some other extra dependencies.
Under 4.16 i used to run my test plugin-fragments fine with this platform as "Junit Plugin Tests".
Eclipse 4.17 cannot launch my tests now due to org.eclipse.pde.junit.runtime and its dependencies missing in the target platform.

Updating the target platform to the latest versions of repositories and dependencies didn't help
Comment 1 Andrey Loskutov CLA 2020-10-02 06:43:29 EDT
Related or duplicate of bug 566642 ?
Comment 2 Julian Honnen CLA 2020-10-02 06:58:58 EDT
(In reply to Alexander Levsha from comment #0)
> Eclipse 4.17 cannot launch my tests now due to org.eclipse.pde.junit.runtime
> and its dependencies missing in the target platform.
Are those missing bundles actually part of your target platform? To check do Ctrl+Shift+A and look for them.

(In reply to Andrey Loskutov from comment #1)
> Related or duplicate of bug 566642 ?
No, that bug only affected features not bundles.


IMO the issue here is that PDE requires the junit.runtime bundles to be part of the target platform.
Those bundles should be in sync with the IDE, not whatever eclipse RCP version you're building against. We have used targets in the past containing eclipse 4.7 and the latest junit.runtime bundles to consume some fixed bugs in them.
Comment 3 Alexander Levsha CLA 2020-10-02 07:36:02 EDT
> Are those missing bundles actually part of your target platform? To check do Ctrl+Shift+A and look for them.

That's the point, i didn't have to include them in the platform before the update.
My understanding is that PDE used to include the test-related bundles from the running platform if the active platform didn't contain them.

Updating my target platform to 2020-09 repositories didn't help until i added JDT and PDE to the platform. Which really have no place there, except as a workaround for this bug.
Comment 4 Julian Honnen CLA 2020-10-02 09:33:24 EDT
(In reply to Alexander Levsha from comment #3)
> That's the point, i didn't have to include them in the platform before the
> update.
You're right. I just tried this in 4.16 and it does indeed work (though only for junit4, junit5 is missing in org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate::getRequiredPlugins).

I did not know this functionality existed. It was removed with bug 527378:
https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/164023/9/ui/org.eclipse.pde.launching/src/org/eclipse/pde/launching/JUnitLaunchConfigurationDelegate.java
(the findPluginInHost call).
Comment 5 Eclipse Genie CLA 2020-10-02 10:23:55 EDT
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/170240
Comment 6 Julian Honnen CLA 2020-10-02 10:33:44 EDT
(In reply to Julian Honnen from comment #4)
> (though only
> for junit4, junit5 is missing in
> org.eclipse.pde.launching.JUnitLaunchConfigurationDelegate::
> getRequiredPlugins).
Opened bug 567552 for this.
Comment 8 Vikas Chandra CLA 2020-10-06 07:50:55 EDT
Julian, can you please verify this fix.
Comment 9 Julian Honnen CLA 2020-10-07 07:10:34 EDT
verified with Build id: I20201006-1800