Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-2010

Parameterized Selection Does not Work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-M5
    • None
    • None
    • Maven 3.6.3 and Ubuntu 20.04, but I suppose it happens everywhere

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              DaGeRe1989 David Georg Reichelt
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: