You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kyle Aure (Jira)" <ji...@apache.org> on 2023/04/18 16:48:00 UTC
[jira] [Commented] (SUREFIRE-1645) Surefire excludedGroups not overriding groups
[ https://issues.apache.org/jira/browse/SUREFIRE-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713657#comment-17713657 ]
Kyle Aure commented on SUREFIRE-1645:
-------------------------------------
This bug still exists today (surefire 3.0.0)
> Surefire excludedGroups not overriding groups
> ---------------------------------------------
>
> Key: SUREFIRE-1645
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1645
> Project: Maven Surefire
> Issue Type: Bug
> Affects Versions: 2.22.1
> Reporter: Ulf Lilleengen
> Priority: Major
>
> 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:
>
> {code:java}
> <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>
> {code}
>
> Whereas the following will not run the test
> {code:java}
> <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>
> {code}
>
> I think the appropriate thing to do is to have exclusion take precedence over inclusion.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)