Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341778 - [JUnit] same tests executed twice when running all tests from container that contains suite
Summary: [JUnit] same tests executed twice when running all tests from container that ...
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-04 09:40 EDT by Nicolas Bros CLA
Modified: 2020-03-30 10:50 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Bros CLA 2011-04-04 09:40:33 EDT
I have a project that contains JUnit 4 tests, and a JUnit 4 test suite:

@RunWith(Suite.class)
@SuiteClasses({ MyFirstTest.class, AnotherTest.class })
public class AllTests {}

When I run all the tests on this project, the tests are being run twice. Presumably once for the test class, and a second time because they are in the test suite.

I think the JUnit launcher should filter out duplicate tests before launching them.
Comment 1 Markus Keller CLA 2011-04-18 12:19:44 EDT
Yeah, we could add special code to handle this situation. However, it's unclear which test should not be run, the standalone or the one in a suite.

Other points to consider:
- a test could also be contained in multiple suites
- suites themselves could be nested
- suites can be incomplete (e.g. contain most of the tests in a package, but not all of them)
Comment 2 Eclipse Genie CLA 2020-03-30 10:50:01 EDT
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.