Skip to content

[SUREFIRE-2010] Parameterized Selection Does not Work #2808

@jira-importer

Description

@jira-importer

David Georg Reichelt opened SUREFIRE-2010 and commented

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 

-Dtest=MyTest#method[$INDEX]

 or 

-Dtest=MyTest#method[*]

 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:

 

[engine:junit-jupiter]/[class:de.dagere.peass.ExampleTest]/[test-template:test(int)]

 

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.


Affects: 3.0.0-M5

Remote Links:

1 votes, 7 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:majorMajor loss of function

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions