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

Bug 527411

Summary: [JUnit 5] JUnit5 support not properly working for PluginUnitTests
Product: [Eclipse Project] JDT Reporter: Reto Urfer <reto.urfer>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: akurtakov, daniel_megert, mistria, noopur_gupta, sarika.sinha
Version: 4.7.1aFlags: daniel_megert: pmc_approved+
sarika.sinha: review+
Target Milestone: 4.7.2   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/112242
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7f92660f683f5cba60c72fea7082acbc3a9eafbf
https://git.eclipse.org/r/112542
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7d010142c76a6a96d5ccf484d183b4a04f6c8310
Whiteboard:
Attachments:
Description Flags
Eclipse junit5 display
none
test project to reproduce the problem none

Description Reto Urfer CLA 2017-11-17 10:45:49 EST
Created attachment 271526 [details]
Eclipse junit5 display

Running a Junit5 testcase as a simple unit test works fine.
If I run the same test case as a Junit5 PluginTest with a corresponding launcher I always get the message "No tests found with test runner 'JUnit 5'.

It seems that the tests have been executed anyway but the test output looks strange (see attached screenshot)
Comment 1 Reto Urfer CLA 2017-11-17 10:47:28 EST
Created attachment 271527 [details]
test project to reproduce the problem
Comment 2 Noopur Gupta CLA 2017-11-24 04:01:36 EST
Thanks for reporting. I will look into it.
Comment 3 Eclipse Genie CLA 2017-11-24 05:30:06 EST
New Gerrit change created: https://git.eclipse.org/r/112242
Comment 5 Noopur Gupta CLA 2017-11-24 06:58:21 EST
It affects the display of dynamic tests and parameterized tests when run as plug-in tests. 

The fix could be added to PDE but I have changed it in JDT so that if there are any other clients of the internal RemoteTestRunner class then they get the fix via JDT.

Released the fix in master branch. 

If there is an RC4 for 4.7.2, it would be good to include the fix. Otherwise, I will backport it to 4.7.3.
Comment 6 Eclipse Genie CLA 2017-11-29 04:50:03 EST
New Gerrit change created: https://git.eclipse.org/r/112542
Comment 7 Noopur Gupta CLA 2017-11-29 04:55:24 EST
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/112542

Sarika, please review for 4.7.2 and confirm if the provided example works with the fix.

A test case for this fix should be added along with bug 521244.
Comment 8 Sarika Sinha CLA 2017-11-29 05:45:23 EST
(In reply to Noopur Gupta from comment #7)
> (In reply to Eclipse Genie from comment #6)
> > New Gerrit change created: https://git.eclipse.org/r/112542
> 
> Sarika, please review for 4.7.2 and confirm if the provided example works
> with the fix.
> 
> A test case for this fix should be added along with bug 521244.

Provided example works fine for 4.7.2.
Changes look logical and this was the way listeners were used for Junit3 and Junit4 as well.
Comment 9 Eclipse Genie CLA 2017-11-29 07:15:45 EST
Gerrit change https://git.eclipse.org/r/112542 was merged to [R4_7_maintenance].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=7d010142c76a6a96d5ccf484d183b4a04f6c8310
Comment 10 Noopur Gupta CLA 2017-11-30 04:16:13 EST
Updated bundle versions in R4_7:
http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?h=R4_7_maintenance&id=1d6de97b73b05f4789fceeb7fa8dfa7b568af7fe

I was under the impression that Gerrit now fails if bundle versions are not updated but the Gerrit build was successful and hence this was missed.
Comment 11 Noopur Gupta CLA 2017-11-30 05:22:16 EST
Verified as fixed in M20171129-1700.
Comment 12 Noopur Gupta CLA 2017-11-30 05:29:19 EST
(In reply to Noopur Gupta from comment #10)
> Updated bundle versions in R4_7:
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?h=R4_7_maintenance&id=1d6de97b73b05f4789fceeb7fa8dfa7b568af7fe
> 
> 
> I was under the impression that Gerrit now fails if bundle versions are not
> updated but the Gerrit build was successful and hence this was missed.

Mickael, Alex, is the Gerrit validation enabled for JDT UI?
Comment 13 Mickael Istria CLA 2017-11-30 05:31:52 EST
(In reply to Noopur Gupta from comment #12)
> Mickael, Alex, is the Gerrit validation enabled for JDT UI?

It is enabled in JDT UI, but only on the master branch as the related changes are in the parent pom 4.8.
Comment 14 Dani Megert CLA 2017-11-30 06:31:29 EST
(In reply to Mickael Istria from comment #13)
> (In reply to Noopur Gupta from comment #12)
> > Mickael, Alex, is the Gerrit validation enabled for JDT UI?
> 
> It is enabled in JDT UI, but only on the master branch as the related
> changes are in the parent pom 4.8.

Is there a problem enabling it for 4.7.x as well?
Comment 15 Alexander Kurtakov CLA 2017-11-30 06:36:01 EST
(In reply to Dani Megert from comment #14)
> (In reply to Mickael Istria from comment #13)
> > (In reply to Noopur Gupta from comment #12)
> > > Mickael, Alex, is the Gerrit validation enabled for JDT UI?
> > 
> > It is enabled in JDT UI, but only on the master branch as the related
> > changes are in the parent pom 4.8.
> 
> Is there a problem enabling it for 4.7.x as well?

Yes, it requires not yet released tycho version.