Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plug-in JUnit Launch does not detec Junit5 tests #650

Open
Pontesegger opened this issue Jun 28, 2023 · 5 comments
Open

Plug-in JUnit Launch does not detec Junit5 tests #650

Pontesegger opened this issue Jun 28, 2023 · 5 comments

Comments

@Pontesegger
Copy link
Contributor

Beginning from 2022-09 I am not able to execute JUnit Plug-in Tests. Works fine with 2022-06 IDE.
(Update: issue still there in 2023-06)

My Setup:

  • Tests provided within fragment project
  • Target definition based on 2022-06
  • Test fragment dependend on:
    org.junit.jupiter.api
    org.junit.jupiter.params
  • Execution environment: Java17

When installing an IDE 2022-06 I have a context menu Run As -> JUnit Plug-in Test.
Further tests execute fine and results are displayed in the JUnit view.

Now I switched to an IDE 2022-09, keeping the rest of my setup above.

Finding 1) the context menu entry Run As -> JUnit Plug-in Test is gone. To make it reappear I have to add following dependencies to my fragment:
org.junit.platform.commons;bundle-version="1.8.1",
org.junit.platform.engine;bundle-version="1.8.1",
org.junit.jupiter.engine;bundle-version="5.8.1"

Finding 2) With the context menu back I can launch Unit tests, but after execution the JUnit view shows 0 tests. Trying to run with coverage reveals that the test code is actually not executed.

Followed it down to RemoteTestRunner.java#516
The count returned is always 0, so test discovery somehow does not work.

@merks
Copy link
Contributor

merks commented Jun 28, 2023

It will probably be good to provide a simple test case that reproduces the problem so that folks can focus on fixing the problem rather than on how exactly to reproduce it.

@Pontesegger
Copy link
Contributor Author

One option is to use the EASE setup from Oomph, then try with any existing unit test

@Pontesegger
Copy link
Contributor Author

How to reproduce:

  • Install Eclipse IDE for Eclipse COmmitters (Version: 2023-06)
  • import example
  • set target platform from com.infineon.sysbox.releng.target
  • open Class Base64Test from com.infineon.tools.test
  • right click in editor, search for Run as / JUnit Plug-in Test -> not there

example.zip

@HannesWell
Copy link
Member

  • Target definition based on 2022-06

Have you tried using a more recent target-platform? IIRC the JUnit-5 bundles got a new symbolic-name at some time in the past, might be around the time when the problem started.
Because in general JUnit-5 tests work.

@HannesWell
Copy link
Member

Respectively this might be to #1006 or #278.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants