Bug 511183 - [JUnit 5] Update JUnit Test Suite wizard for JUnit 5
Summary: [JUnit 5] Update JUnit Test Suite wizard for JUnit 5
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 539000 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-27 07:35 EST by Noopur Gupta CLA
Modified: 2023-11-20 19:43 EST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Noopur Gupta CLA 2017-01-27 07:35:29 EST
The "New JUnit Test Suite" wizard has options to create JUnit 3 and JUnit 4 suites. It can be updated to create JUnit Jupiter test suites, if applicable.

I couldn't find a way to create a test suite for JUnit Jupiter that can be run with JUnit 5.

@RunWith(JUnitPlatform.class) is used with a suite to run it with JUnit 4, and not with JUnit 5.

@Sam, could you please provide some details here? 

I am not sure what new option would be useful in this wizard for JUnit 5.
Comment 1 Markus Keller CLA 2017-02-07 06:54:41 EST
AFAICS, test discovery is supposed to replace the need for user-written test suites: http://junit.org/junit5/docs/current/user-guide/#launcher-api

The idea seems to be that each environment reinvents the wheel and provides a separate language to describe which tests should be included in a test run.
For example in Gradle: http://junit.org/junit5/docs/current/user-guide/#running-tests-build-gradle

That is a huge step backwards. JUnit 5 should provide a standard way for users to  store a test discovery request in a common format. http://junit.org/junit5/docs/current/user-guide/#launcher-api-discovery looks like LauncherDiscoveryRequest is the holder for all the necessary information to compose the equivalent of a test suite, but I don't see a standard way how users should store such a request for later use by a launcher (like Eclipse's JUnit launch configurations).

Sam, did I miss something, or do you have plans to specify a common way for users to provide a LauncherDiscoveryRequest? E.g. a static suite method like this:

public static LauncherDiscoveryRequest suite() {
    LauncherDiscoveryRequestBuilder.request()...
}

The JUnit 5 wizard could then generate a suite class that selects all tests by default, and which users can adapt to their needs.
Comment 2 Sam Brannen CLA 2017-08-22 11:25:15 EDT
> @RunWith(JUnitPlatform.class) is used with a suite to run it with JUnit 4, and not with JUnit 5.

That's correct.

The only way to run a "suite" on the JUnit Platform is currently via the JUnit 4 Runner (i.e., JUnitPlatform.class) as you pointed out.

> @Sam, could you please provide some details here? 

We in fact moved the suite API annotations to the JUnit Platform in milestone 4:

https://github.com/junit-team/junit5/issues/681

And we have "plans" to implement suite support on the platform, but we have not yet gotten to it. See the following issue for details.

https://github.com/junit-team/junit5/issues/744

Regards,

Sam
Comment 3 Sam Brannen CLA 2017-08-22 12:07:03 EDT
Hi Markus,

> Sam, did I miss something, or do you have plans to specify a common way for users to provide a LauncherDiscoveryRequest? E.g. a static suite method like this:

Nope, you didn't miss anything.

Our current plans (see previous link to issue #744) are to support the existing suite API annotations on some type of class (or interface) that is picked up automatically by the JUnit Platform itself (i.e., not by a particular TestEngine).

We did in fact have such a static method in place at one point for the JUnitPlatform Runner, but we decided against that approach.

If you'd like to provide the JUnit Team further input, please add your comments to issue #744.

Cheers!

Sam
Comment 4 Noopur Gupta CLA 2017-09-01 07:57:46 EDT
Removing dependency to bug 488566 (see above comments and https://github.com/junit-team/junit5/issues/744).
Comment 5 Noopur Gupta CLA 2019-06-10 04:26:02 EDT
*** Bug 539000 has been marked as a duplicate of this bug. ***
Comment 6 Eclipse Genie CLA 2021-11-29 19:14:47 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 7 Eclipse Genie CLA 2023-11-20 19:43:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.