-
Notifications
You must be signed in to change notification settings - Fork 188
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
Support JUnit @DisplayName #198
Comments
I think it's a bug, @DisplayName is supposed to work. |
I'm using tycho-surefire 2.3.0 and JUnit 5.7.2
and .pom
It generates report like that:
|
And one additional question: is this possible to include logs into passed test cases? |
The behaviour of the maven-surefire-plugin changed some time ago; as far as i remeber there is a difference between JUnit4 and JUnit5 when it comes to handling display-name; The new version of the surefire-plugin requiers additional configuration (see https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html#Surefire_Extensions_and_Reports_Configuration_for_.40DisplayName ). So far i wasn't able to figure out how to set these options when using tycho-surefire? |
I wonder if this would be possible using the providerProperties on the Tycho mojo? However I've just seen that support for this was added to maven-surefire in version 3.0.0-M4 but Tycho currently uses 2.22.2 so that would probably have to be upgraded first I think. |
Tycho 3.0.0-SNAPSHOT does now have a version of Surefire that supports this however passing the required configuration looks like it might be non-trivial. The configuration for tycho-surefire ( In Maven Surefire the required We would need a way to recreate these objects in the booter but the One option could be to add a tycho-surefire parameter such as Does this make sense? |
Your best option would be to fetch the code and try out some of your suggestions, if your happy with them open a PR so we can discuss it. |
Have created a draft PR based on my previous comment. |
If the test provider is the JUnitPlatformProvider then set up the surefire reporting for JUnit5. Issue eclipse-tycho#198.
If the test provider is JUnitPlatformProvider then set up the Surefire reporting for JUnit5 as suggested in the Surefire documentation. In the maven-surefire-plugin this configuration is expressed in the pom. This approach does not work for Tycho as we have a separate OSGi process executing the tests. Instead we use the provider name to determine the reporting. This doesn't offer the same flexibility as maven-surefire-plugin but should be sufficient for initial support. Fixes eclipse-tycho#198
Hi. I'm using JUnit for run tests and it turns out that the @DisplayName does not work with tycho-surefire. I don't really care if I can use this particular annotation, it is important for me to change the names of the suites and test cases. Is there any way to do this?
The text was updated successfully, but these errors were encountered: