David Georg Reichelt created SUREFIRE-2010:
----------------------------------------------
Summary: Parameterized Selection Does not Work
Key: SUREFIRE-2010
URL: https://issues.apache.org/jira/browse/SUREFIRE-2010
Project: Maven Surefire
Issue Type: Bug
Components: Junit 4.x support, JUnit 5.x support
Affects Versions: 3.0.0-M5
Environment: Maven 3.6.3 and Ubuntu 20.04, but I suppose it happens
everywhere
Reporter: David Georg Reichelt
In the current version (and also M6-SNAPSHOT), maven surefire is not capable of
selecting parameterized tests based on the index. In
[https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html,]
it is described that this should work by providing the index, e.g. using
{code:java}
-Dtest=MyTest#method[$INDEX]{code}
or
{code:java}
-Dtest=MyTest#method[*]{code}
for all.
This happens both for JUnit 4 and JUnit 5.
I created a mwe demonstrating this problem:
[https://github.com/DaGeRe/parameterized-selection-demo]
As far as I see it, the TestMethodFilter in
[https://github.com/apache/maven-surefire/blob/master/surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/TestMethodFilter.java#L45]
does the filtering, but has only a descriptor in the form:
{code:java}
[engine:junit-jupiter]/[class:de.dagere.peass.ExampleTest]/[test-template:test(int)]{code}
So there is not the concrete value, but only the information that an int should
be provided. Therefore, I currently see not any option to fix this easily or
get this running using a regex pattern.
Do I oversee something, or is it planned to fix this? If not, it would be
better to update the documentation site accordingly.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)