You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tibor Digana (Jira)" <ji...@apache.org> on 2022/02/19 18:07:00 UTC

[jira] [Commented] (SUREFIRE-2018) Tests not excluded when dependency label used within the plugin

    [ https://issues.apache.org/jira/browse/SUREFIRE-2018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17495022#comment-17495022 ] 

Tibor Digana commented on SUREFIRE-2018:
----------------------------------------

[~puchengyang]
Have you seen our documentations about the Surefire providers and inclusions/exclusions?
https://maven.apache.org/surefire/maven-surefire-plugin/examples/junit-platform.html
https://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html

> Tests not excluded when dependency label used within the plugin
> ---------------------------------------------------------------
>
>                 Key: SUREFIRE-2018
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-2018
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin
>    Affects Versions: 3.0.0-M5
>            Reporter: Pucheng Yang
>            Priority: Major
>
> Hi there, I found a strange issue for me, not sure if it is a bug or I did something wrong. Could you help me take a look? thanks.
> I am trying to exclude a test when working on a open source project (https://github.com/trinodb/trino/blob/master/core/trino-main/pom.xml#L489), here is the original plugin definition
> {code:java}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <dependencies>
>         <!-- allow both JUnit and TestNG -->
>         <dependency>
>             <groupId>org.apache.maven.surefire</groupId>
>             <artifactId>surefire-junit-platform</artifactId>
>             <version>${dep.plugin.surefire.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven.surefire</groupId>
>             <artifactId>surefire-testng</artifactId>
>             <version>${dep.plugin.surefire.version}</version>
>         </dependency>
>     </dependencies>
> </plugin> {code}
> to exclude certain tests, this is what I do
> {code:java}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-surefire-plugin</artifactId>
>     <dependencies>
>         <!-- allow both JUnit and TestNG -->
>         <dependency>
>             <groupId>org.apache.maven.surefire</groupId>
>             <artifactId>surefire-junit-platform</artifactId>
>             <version>${dep.plugin.surefire.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven.surefire</groupId>
>             <artifactId>surefire-testng</artifactId>
>             <version>${dep.plugin.surefire.version}</version>
>         </dependency>
>     </dependencies>
>     <configuration>
>         <excludes>
>             <exclude>**/TestFileSingleStreamSpillerFactory.java</exclude>
>         </excludes>
>     </configuration>
> </plugin>{code}
> However, when I run maven test, this test is not excluded. I tried commented out the dependency part, and I can exclude it.
> {code:java}
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-surefire-plugin</artifactId>
> <!--                <dependencies>-->
> <!--                    &lt;!&ndash; allow both JUnit and TestNG &ndash;&gt;-->
> <!--                    <dependency>-->
> <!--                        <groupId>org.apache.maven.surefire</groupId>-->
> <!--                        <artifactId>surefire-junit-platform</artifactId>-->
> <!--                        <version>${dep.plugin.surefire.version}</version>-->
> <!--                    </dependency>-->
> <!--                    <dependency>-->
> <!--                        <groupId>org.apache.maven.surefire</groupId>-->
> <!--                        <artifactId>surefire-testng</artifactId>-->
> <!--                        <version>${dep.plugin.surefire.version}</version>-->
> <!--                    </dependency>-->
> <!--                </dependencies>-->
>                 <configuration>
>                     <excludes>
>                         <exclude>**/TestFileSingleStreamSpillerFactory.java</exclude>
>                     </excludes>
>                 </configuration>
>             </plugin> {code}
> I wonder did I miss something? thanks.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)