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

Regression in excludes feature between surefire 2.6 and 2.7.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7, 2.7.1, 2.7.2, 2.8, 2.8.1, 2.9
    • 2.10
    • Junit 4.x support
    • None

    Description

      I have a build that excludes certain JUnit 4 test cases by allowing users to specify a -Dtest.exclude.pattern=*/TestA.java,*/TestB.java style command line argument. This worked for surefire 2.5, 2.6 but fails to work in 2.7, 2.7.1, 2.7.2, 2.8, 2.8.1, and 2.9 releases.

      Here's how I pass in the excludes from the command line:

      ...
      <plugins> <plugin>
        <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                <forkMode>always</forkMode>
                <includes>
                  <include>**/Test*.java</include>
                </includes>
                <excludes>
                  <exclude>**/*$*</exclude>
                  <exclude>${test.exclude.pattern}</exclude>
                </excludes>
      ...
      

      and

      ...
      <properties>
         ...
         <!-- For flaky tests exclusion -->
          <test.exclude />
          <test.exclude.pattern>**/${test.exclude}.java</test.exclude.pattern>
        </properties>
      ...
      

      Attachments

        Activity

          People

            pgier Paul Gier
            jmhsieh Jonathan Hsieh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: