Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.22.1
-
None
-
None
-
None
Description
With maven-surefire-plugin 2.22.1 and junit platform 1.4.0, junit 5 tests that have tags both in the included and excluded groups will always include the tests. This behavior is different when adding the dependency on junit-platform-surefire-provider 1.3.2, which will cause the exclusion to take precedence over the inclusion.
Assuming a test is tagged with both tag1 and tag2, the following will run the test:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> <configuration> <properties> <groups>tag1</groups> <excludedGroups>tag2</excludedGroups> </properties> </configuration> </plugin>
Whereas the following will not run the test
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <properties> <groups>tag1</groups> <excludedGroups>tag2</excludedGroups> </properties> </configuration> <dependencies> <dependency> <groupId>org.junit.platform</groupId> <artifactId>junit-platform-surefire-provider</artifactId> <version>1.3.2</version> </dependency> </dependencies> </plugin>
I think the appropriate thing to do is to have exclusion take precedence over inclusion.