Run JUnit 5 tests with TestNG

357 views
Skip to first unread message

Emilie Prevost

unread,
Mar 15, 2021, 10:52:14 AM3/15/21
to testng-users

Hi,

I would like to know if it's somehow possible to run Junit5 tests with TestNG in order to have the xml report. I'm working on a plugin to include in projects (with different test frameworks) to produce customized TestNG reports for tests results import in Jira Xray. TestNG xml reports offers more options than JUnit ones (and Xray currently only supports TestNG reports customization) and it's why I would prefer to have all tests running through it. Is there a class/interface I could override to do so? Is it planned to eventually support JUnit 5 tests?

Julien Herr

unread,
Mar 15, 2021, 10:59:45 AM3/15/21
to testng-users
Hi,

As said on the related testng-junit5 issue (https://github.com/testng-team/testng-junit5/issues/23#issuecomment-798897877): there is no plan to support JUnit5 in TestNG.

If you are using JUnit5, a better option is to ask them to improve their reporting API.
With the testng-junit5 project, you'll be able to run TestNG tests from JUnit5.

About reporting, you'll find an interesting discussion at https://github.com/ota4j-team/opentest4j/issues/9 

Emilie Prevost

unread,
Mar 15, 2021, 1:06:11 PM3/15/21
to testng-users
Hi,

Thank you for your answers. I know Xray Team has already asked JUnit Team to improve customization and it's currently in process. However, our Xray version (server) does not support JUnit xml customization (mapping with tests requirements, existing tests, labels) for now (don't know if it's planned). So, I'm more searching for a quick fix until JUnit 5 report customization is supported by Xray and JUnit. For now, TestNG JUnit3-4 support is very useful to us. I guess we'll have to wait for more options with Junit 5 based projects...

Reply all
Reply to author
Forward
0 new messages